+ Started POST route for spells (w/ validation) and applied changes

This commit is contained in:
Alexis
2020-05-16 14:59:10 +02:00
parent bf8205c679
commit 8468fe235a
2 changed files with 8 additions and 3 deletions

View File

@@ -2,8 +2,9 @@
// MODULES
const express = require('express')
const bodyParser = require('body-parser')
const helmet = require('helmet')
const morgan = require('morgan');
const morgan = require('morgan')
const cors = require('cors') // module to format the json response
// Creates instances of database connections
@@ -18,8 +19,9 @@ const routes = require('./routes')
// Builds app w/ express
let app = express()
app.use(bodyParser.json())
app.use(cors())
app.use(morgan('combined'))
app.use(morgan('tiny'))
app.use(helmet())
// Serves
@@ -27,3 +29,4 @@ const server = app.listen( port, () => {console.log(`App listening on port ${por
// Routing
app.use('/api/spells', routes.spells)
app.use('/api/schools', routes.schools)