Running Notes with SQLite3

Finally, we're ready to run the Notes application with SQLite3. Add the following code to the scripts section of package.json:

"start-sqlite3": "SQLITE_FILE=chap07.sqlite3 NOTES_MODEL=sqlite3 node --experimental-modules ./bin/www.mjs",

Run the Notes application:

$ DEBUG=notes:* npm run start-sqlite3
    
> notes@0.0.0 start-sqlite3 /Users/david/chap07/notes
> SQLITE_FILE=chap07.sqlite3 NOTES_MODEL=models/notes-sqlite3 node ./bin/www.mjs
    
  notes:server Listening on port 3000 +0ms
  notes:sqlite3-model Opened SQLite3 database chap07.sqlite3 +5s  

You can now browse the application at http://localhost:3000, and run it through its paces as before.

Because SQLite3 supports simultaneous access from multiple instances, you can ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.