chore: changed some header

This commit is contained in:
Junseo Park 2021-06-07 17:26:52 +09:00 committed by GitHub
parent 87500a98c6
commit f7aa6f8ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ export default function ResponseWrapper<T = unknown>(
) {
if (!code) throw new Error('`code` is required.')
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.json({
code,
@ -22,4 +22,4 @@ interface ApiResponse {
status(status: string|number): void
setHeader(key: string, value: string): void
json(json: unknown): void
}
}