May 2018
Intermediate to advanced
492 pages
12h 3m
English
Now that we have our MongoDB model, we can get ready to run Notes with it.
By now you know the drill; add this to the scripts section of package.json:
"start-mongodb": "MONGO_URL=mongodb://localhost/ MONGO_DBNAME=chap07 NOTES_MODEL=mongodb node --experimental-modules ./bin/www.mjs",
The MONGO_URL environment variable is the URL to connect with your MongoDB database.
You can start the Notes application as follows:
$ DEBUG=notes:* npm run start-mongodb
> notes@0.0.0 start-mongodb /Users/david/chap07/notes
> MONGO_URL=mongodb://localhost/ MONGO_DBNAME=chap07 NOTES_MODEL=mongodb node --experimental-modules ./bin/www
notes:server Listening on port 3000 +0ms
You can browse the application at http://localhost:3000 ...
Read now
Unlock full access