pouet
This commit is contained in:
parent
70d52c096d
commit
e41e81d162
@ -4,7 +4,7 @@ import node from "@astrojs/node";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
// site: 'https://www.nasap3d.com',
|
||||
site: 'https://print.dzeio.com',
|
||||
integrations: [tailwind()],
|
||||
build: {
|
||||
assets: 'assets'
|
||||
|
@ -1,54 +0,0 @@
|
||||
import { Response } from 'express'
|
||||
|
||||
/**
|
||||
* An error as of the RFC7807
|
||||
*
|
||||
* you MUST send the content-type `application/problem+json`
|
||||
*/
|
||||
export default interface HTTPError extends Record<string, any> {
|
||||
/**
|
||||
* A URI reference [RFC3986] that identifies the
|
||||
* problem type. This specification encourages that, when
|
||||
* dereferenced, it provide human-readable documentation for the
|
||||
* problem type (e.g., using HTML [W3C.REC-html5-20141028]). When
|
||||
* this member is not present, its value is assumed to be
|
||||
* "about:blank".
|
||||
*/
|
||||
title: string
|
||||
/**
|
||||
* A short, human-readable summary of the problem
|
||||
* type. It SHOULD NOT change from occurrence to occurrence of the
|
||||
* problem, except for purposes of localization (e.g., using
|
||||
* proactive content negotiation; see [RFC7231], Section 3.4).
|
||||
*/
|
||||
type?: string
|
||||
|
||||
/**
|
||||
* The HTTP status code ([RFC7231], Section 6)
|
||||
* generated by the origin server for this occurrence of the problem.
|
||||
*/
|
||||
status?: number
|
||||
|
||||
/**
|
||||
* A human-readable explanation specific to this
|
||||
* occurrence of the problem.
|
||||
*/
|
||||
detail?: string
|
||||
|
||||
|
||||
/**
|
||||
* A URI reference that identifies the specific
|
||||
* occurrence of the problem. It may or may not yield further
|
||||
* information if dereferenced.
|
||||
*/
|
||||
instance?: string
|
||||
}
|
||||
|
||||
export function createErrorResponse(res: Response, error: HTTPError) {
|
||||
res.status(error.status ?? 500)
|
||||
if (!error.type) {
|
||||
error.type = 'about:blank'
|
||||
}
|
||||
res.setHeader('Content-Type', 'application/problem+json')
|
||||
res.json(error)
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
import { objectMap, objectOmit } from '@dzeio/object-util'
|
||||
import URLManager from '@dzeio/url-manager'
|
||||
import type { APIRoute } from 'astro'
|
||||
import { exec as execSync } from 'child_process'
|
||||
import fs from 'fs/promises'
|
||||
import { evaluate } from 'mathjs'
|
||||
import { exec as execSync } from 'node:child_process'
|
||||
import fs from 'node:fs/promises'
|
||||
import os from 'node:os'
|
||||
import path from 'node:path/posix'
|
||||
import { promisify } from 'node:util'
|
||||
|
Loading…
x
Reference in New Issue
Block a user