mirror of
https://github.com/ringtools/ringtools-server-ts.git
synced 2024-05-16 05:44:40 +02:00
Fix CORS and exit
This commit is contained in:
parent
a72da0c7f8
commit
c4c7288d39
2 changed files with 8 additions and 4 deletions
10
src/app.ts
10
src/app.ts
|
@ -21,14 +21,16 @@ const build = (opts = {}) => {
|
|||
.register(fastifyStatic, {
|
||||
root: path.join(__dirname, '../public'),
|
||||
})
|
||||
.register(socketioServer)
|
||||
.register(fastifyCors)
|
||||
.register(socketioServer, {
|
||||
cors: {
|
||||
origin: true,
|
||||
},
|
||||
})
|
||||
.register(fastifySensible)
|
||||
.register(bootstrap, {
|
||||
directory: resolve(__dirname, 'controllers'),
|
||||
mask: /\.controller\./,
|
||||
})
|
||||
.register(fastifyCors, {
|
||||
origin: '*',
|
||||
});
|
||||
|
||||
return app;
|
||||
|
|
|
@ -18,3 +18,5 @@ server.listen(process.env.PORT || 7464, '::', (err, address) => {
|
|||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
process.on('SIGINT', () => process.exit(1));
|
||||
|
|
Loading…
Add table
Reference in a new issue