← 返回首页
GitHub - cedrickchee/painless-pg-node: Painless PostgreSQL Node.js backend with Objection + Knex + Express · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

cedrickchee/painless-pg-node

 master
Go to file
Code

Repository files navigation

More items

Painless Node.js API with SQL Database

A minimal scaffold project that shows how to painlessly build a robust API with SQL database on Node.js.

What's included

  • node-postgres - Node.js modules for interfacing with PostgreSQL database
  • Knex.js - SQL query builder
  • Objection.js - An SQL-friendly ORM built on Knex for Node.js
  • Express.js - Web framework for Node.js. A myriad of HTTP utility methods for creating API easily.

What does it do

It provides a simple idea/comment database and shows how relation can be modelled with Objection Model class. It also shows how to use eager loading to get related queries.

Development

  • Clone this repo: git clone https://github.com/cedrickchee/painless-pg-node.git
  • cd painless-pg-node
  • npm install to install required project dependencies.
  • Modify database connection according to your machine in knexfile.js.
  • Run it:
    • npm start to start the production server.
    • npm run dev to start the development server.
  • Point your browser to http://localhost:3000/ideas to test if it's working.

About

Painless PostgreSQL Node.js backend with Objection + Knex + Express

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Footer

© 2026 GitHub, Inc.