Skip to content

Commit

Permalink
Add Cors
Browse files Browse the repository at this point in the history
  • Loading branch information
singhalkarun committed Jan 12, 2024
1 parent 88d17c5 commit 5c30105
Show file tree
Hide file tree
Showing 3 changed files with 460 additions and 21 deletions.
4 changes: 3 additions & 1 deletion server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as fs from 'fs';
import Bun from 'bun';
import express from 'express';
import swagger from './util/swagger';
import cors from 'cors';

const buffer = fs.readFileSync('./db.mmdb');
const reader = Reader.openBuffer(buffer);
Expand Down Expand Up @@ -75,13 +76,14 @@ const app = new Router()
}
});

app.use(cors())

app.use(404, () => {
return new Response(Bun.file(__dirname + '/www/404.html'))
});

app.port = (process.env.PORT || 3000);
app.hostname = '0.0.0.0';


swaggerApp.listen(3001, () => console.log('Swagger listening on port 3000'))
app.listen();
Loading

0 comments on commit 5c30105

Please sign in to comment.