O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting the app

Let's start by calling the mongoose-connection module to open a connection to MongoDB. Open the server.js file and apply the following changes:

const express = require('express')const bodyParser = require('body-parser')const teamsApi = require('./src/routes/teams-api')const mongooseConfig = require('./src/config/mongoose-connection')const app = express()app.use(bodyParser.json())app.use(teamsApi)...

That's all we need to establish a new connection. The mongoose-connection file contains the logic to open a connection to MongoDB, so we don't need to type more code.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required