Code sample to show the backend setup of a generic blogsite using the node package Bookshelf. Common packages such as Express, Bluebird, and Async are also in use. Database is in PostgreSQL.
Upon successful user login, a user token will be returned by the server. It's to be used for verification with most other HTTP requests listed here, such as getting a list of blogposts written by a particular user.