mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: cors header
This commit is contained in:
parent
e750b82ab0
commit
c8c9bf6ca6
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user