- [API] Finished the request to get all spells (associated tables for instance)

This commit is contained in:
Alexis
2020-03-28 20:45:44 +01:00
parent 481ed7507f
commit 27a1113bd2
5 changed files with 113 additions and 46 deletions

View File

@@ -1,23 +1,25 @@
'use strict';
// MODULES
const express = require('express');
const express = require('express')
const connection = require('./database/connection');
const db = connection.db;
//
const routes = require('./routes');
const connection = require('./database/connection')
const db = connection.db
// CONSTANTS
const port = 2814;
const port = 2814
// APP
app = express();
const server = app.listen( port, () => {console.log(`App listening on port ${port}`)});
// Import routes
const routes = require('./routes')
app.use('/spells', routes.spells);
// Builds app
let 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();
db.end()
server.close()
})