diff --git a/index.js b/index.js index 90d9a12..9780040 100644 --- a/index.js +++ b/index.js @@ -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) \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index 5bfe085..dcef834 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,5 +1,7 @@ -const spells = require('./spells'); +const spells = require('./spells') +const schools = require('./schools') module.exports = { spells, + schools, } \ No newline at end of file