diff options
author | Fawn <fangrui_tong@brown.edu> | 2020-01-09 15:52:05 -0500 |
---|---|---|
committer | Fawn <fangrui_tong@brown.edu> | 2020-01-09 15:52:05 -0500 |
commit | 9a8d2a903b10568686cc66c849fba21b1ab75be2 (patch) | |
tree | ea0bf48e4f47c72f9eeab3cbd00a5f1494abbb34 /src/server/server_Initialization.ts | |
parent | e0a8d325d601d305a166c1683dccfcc67e91fe95 (diff) | |
parent | 540bda7295f6ee7c2eed848598de6f5df74b2723 (diff) |
pull and merge with master
Diffstat (limited to 'src/server/server_Initialization.ts')
-rw-r--r-- | src/server/server_Initialization.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/server_Initialization.ts b/src/server/server_Initialization.ts index 0f502e8fb..cbe070293 100644 --- a/src/server/server_Initialization.ts +++ b/src/server/server_Initialization.ts @@ -22,7 +22,7 @@ import { publicDirectory } from '.'; import { logPort, } from './ActionUtilities'; import { timeMap } from './ApiManagers/UserManager'; import { blue, yellow } from 'colors'; -var cors = require('cors'); +import * as cors from "cors"; /* RouteSetter is a wrapper around the server that prevents the server from being exposed. */ @@ -33,13 +33,11 @@ export default async function InitializeServer(routeSetter: RouteSetter) { const app = buildWithMiddleware(express()); app.use(express.static(publicDirectory, { - setHeaders: (res, path) => { - res.setHeader("Access-Control-Allow-Origin", "*"); - } + setHeaders: res => res.setHeader("Access-Control-Allow-Origin", "*") })); app.use("/images", express.static(publicDirectory)); const corsOptions = { - origin: function (origin: any, callback: any) { + origin: function (_origin: any, callback: any) { callback(null, true); } }; |