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

24 lines
448 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();
})