- [All] Finished API call for spells and various bug fixes

This commit is contained in:
Alexis
2020-04-01 19:01:03 +02:00
parent 27a1113bd2
commit 37f4913d3e
9 changed files with 263 additions and 53 deletions

View File

@@ -2,6 +2,7 @@
// MODULES
const express = require('express')
const cors = require('cors')
const connection = require('./database/connection')
const db = connection.db
@@ -14,9 +15,10 @@ const routes = require('./routes')
// Builds app
let app = express()
app.use(cors())
const server = app.listen( port, () => { console.log(`App listening on port ${port}`)} )
app.use('/spells', routes.spells)
app.use('/api/spells', routes.spells)
// On process kill with SIGINT
process.on('SIGINT', () => {