express-knex-objection
express-knex-objection copied to clipboard
A simple API system on a pg database, using knex and objection to simplify connection and management
Express/Knex/Objection
A simple scaffold application for showing database connection and management on Node.js The guide leading to this result can be found here.
What's included
pg- PostreSQL moduleknex- Query builderobjection- ORM built upon Knexexpress- API framework
What does it do
It provides a simple user/message database and shows how relation can be modelled with Objection Model class. It also shows how to use eager loading to get related queries.
How to use it
- Clone this repo:
git clone https://github.com/Fodark/express-knex-objection cd express-knex-objectionnpm installto install required packages- Modify database connection according to your machine in
knexfile.js npm startto start the server- Point to
localhost:3000/api/usersto test if it's working