This repository has been archived on 2026-06-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
spellsaurus/index.js
2020-03-23 18:35:13 +01:00

25 lines
482 B
JavaScript

// MODULES
const express = require('express');
const connection = require('./database/connection');
const db = connection.db;
//
const routes = require('./routes');
// CONSTANTS
const port = 2814;
// APP
app = express();
const server = app.listen( port, () => {console.log(`App listening on port ${port}`)});
app.use('/spells', routes.spells);
// On process kill with SIGINT
process.on('SIGINT', () => {
db.end();
server.close();
console.log('Server closed');
})