Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spoonx/express-wetland
Wetland middleware for expressJS.
https://github.com/spoonx/express-wetland
database express middleware mysql nodejs orm postgresql sqlite
Last synced: about 1 month ago
JSON representation
Wetland middleware for expressJS.
- Host: GitHub
- URL: https://github.com/spoonx/express-wetland
- Owner: SpoonX
- License: mit
- Created: 2017-02-22T15:50:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T16:01:05.000Z (almost 8 years ago)
- Last Synced: 2024-11-21T22:16:30.845Z (about 1 month ago)
- Topics: database, express, middleware, mysql, nodejs, orm, postgresql, sqlite
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-wetland
A super simple piece of [express](http://expressjs.com/) middleware that patches requests with methods that make working with [wetland](https://wetland.spoonx.org) a breeze.## Installation
### With npm
`npm i express-wetland --save`### With yarn
`yarn add express-wetland`## Usage
```js
const expressWetland = require('express-wetland');
const wetland = new Wetland(yourConfig);app.use(expressWetland(wetland));
```### Methods
#### req.getManager()
Returns an entity manager scope that only applies to the request, and only lives as long as the request.#### req.getRepository(Entity)
Returns the repository for given `Entity` reference, or Entity's identity string.#### req.wetland
This is the wetland instance you passed in to the middleware on config.## License
MIT