Browse Source

feat: Add cors to static

tags/v0.2.0
Dale 1 year ago
parent
commit
9b7117236d
3 changed files with 5 additions and 1 deletions
  1. +1
    -0
      package.json
  2. +3
    -1
      src/server.ts
  3. +1
    -0
      src/typings.d.ts

+ 1
- 0
package.json View File

@@ -16,6 +16,7 @@
"async-shelljs": "^0.1.2",
"axios": "^0.19.0",
"ejs": "^2.6.1",
"cors": "^2.8.5",
"express": "^4.17.1",
"gamedig": "^2.0.14",
"mumble-ping": "^1.0.0",


+ 3
- 1
src/server.ts View File

@@ -1,4 +1,6 @@
import * as Express from 'express';
import cors from 'cors';


import {serveDomains} from 'src/lib/domains';
import statusRouter from 'src/domains/status';
@@ -18,7 +20,7 @@ const domains = developing ? {

const dispatcher = serveDomains(domains);

app.use('/static', Express.static('static'));
app.use('/static', cors, Express.static('static'));
app.use(dispatcher);

app.listen(8080, () => {


+ 1
- 0
src/typings.d.ts View File

@@ -1,2 +1,3 @@
declare module '@nrk/nodecache-as-promised';
declare module 'mumble-ping';
declare module 'cors';

Loading…
Cancel
Save