File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import express from 'express'
22import http from 'http'
3- import { pickMethod , pickPath } from 'serverlet'
3+ import { pickMethod , pickPath , withCors } from 'serverlet'
44import { makeExpressRoute } from 'serverlet/express'
55
66import { config } from '../config'
@@ -18,15 +18,15 @@ async function main(): Promise<void> {
1818}
1919
2020function 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 ( )
You can’t perform that action at this time.
0 commit comments