mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +00:00
fix: set header first
This commit is contained in:
parent
f7ed8b233d
commit
08342bca6d
@ -7,8 +7,8 @@ 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.status(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.json({
|
res.json({
|
||||||
code,
|
code,
|
||||||
data,
|
data,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user