mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 06:20:24 +00:00
chore: changed some header
This commit is contained in:
parent
87500a98c6
commit
f7aa6f8ad6
@ -7,7 +7,7 @@ export default function ResponseWrapper<T = unknown>(
|
|||||||
) {
|
) {
|
||||||
if (!code) throw new Error('`code` is required.')
|
if (!code) throw new Error('`code` is required.')
|
||||||
if (!http.STATUS_CODES[code]) throw new Error('Invalid http code.')
|
if (!http.STATUS_CODES[code]) throw new Error('Invalid http code.')
|
||||||
res.setHeader('Access-Control-Allow-Origin', process.env.KOREANBOTS_URL)
|
res.setHeader('Access-Control-Allow-Origin', '*') // process.env.KOREANBOTS_URL
|
||||||
res.status(code)
|
res.status(code)
|
||||||
res.json({
|
res.json({
|
||||||
code,
|
code,
|
||||||
@ -22,4 +22,4 @@ interface ApiResponse {
|
|||||||
status(status: string|number): void
|
status(status: string|number): void
|
||||||
setHeader(key: string, value: string): void
|
setHeader(key: string, value: string): void
|
||||||
json(json: unknown): void
|
json(json: unknown): void
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user