Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elmariachi111/demo-dbusage-on-node
Shows how to handle only one db connection ind a node applicatoin using a module.exports "singleton"
https://github.com/elmariachi111/demo-dbusage-on-node
Last synced: about 1 month ago
JSON representation
Shows how to handle only one db connection ind a node applicatoin using a module.exports "singleton"
- Host: GitHub
- URL: https://github.com/elmariachi111/demo-dbusage-on-node
- Owner: elmariachi111
- Created: 2013-09-05T09:51:17.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-02T00:24:12.000Z (almost 11 years ago)
- Last Synced: 2023-03-30T03:07:44.911Z (over 1 year ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
demo-dbusage-on-node
====================Demonstrates various ways how to handle db connections in a node application
See my article on [Wordpress](http://stadolf.wordpress.com/2013/12/02/wiring-up-dependencies-in-node-js-wrap-up-of-my-best-practices-2/) for explanations. To install simply clone the repo and `npm install`. The examples are in ioc_1 - ioc3 and in nodeonly. Enter one of those directories and type node app.js. Then use your [favorite REST-client](http://www.getpostman.com/) to access the routes
`GET /foo` -> lists all entries in the database
`POST /foo` -> (set `Content-type: application/json` header) + body `{"info":"bar"}`
`GET /foo/1` -> show entry with id 1