Skip to content

Commit 21cfe95

Browse files
committed
Allow cors
1 parent 547d82c commit 21cfe95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/v3/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import express from 'express'
22
import http from 'http'
3-
import { pickMethod, pickPath } from 'serverlet'
3+
import { pickMethod, pickPath, withCors } from 'serverlet'
44
import { makeExpressRoute } from 'serverlet/express'
55

66
import { config } from '../config'
@@ -18,15 +18,15 @@ async function main(): Promise<void> {
1818
}
1919

2020
function server(): void {
21-
const server = pickPath({
21+
const server = withCors(pickPath({
2222
'/': pickMethod({ GET: heartbeatV3 }),
2323
'/v2/exchangeRate': pickMethod({ GET: rateV2 }),
2424
'/v2/exchangeRates': pickMethod({ POST: ratesV2 }),
2525
'/v2/coinrank': pickMethod({ GET: sendCoinranksV2 }),
2626
'/v2/coinrankAsset/([^/]+)': pickMethod({ GET: sendCoinrankAssetV2 }),
2727
'/v2/coinrankList': pickMethod({ GET: sendCoinrankListV2 }),
2828
'/v3/rates': pickMethod({ POST: ratesV3 })
29-
})
29+
}))
3030

3131
// Set up Express:
3232
const app = express()

0 commit comments

Comments
 (0)