https://github.com/ekliptor/expressutils
Helper functions for the Express framework (expressjs.com) to render templates, write meta tags, perform localization, implement REST APIs and more.
https://github.com/ekliptor/expressutils
express express-middleware expressjs mongodb nodejs webapp
Last synced: 2 months ago
JSON representation
Helper functions for the Express framework (expressjs.com) to render templates, write meta tags, perform localization, implement REST APIs and more.
- Host: GitHub
- URL: https://github.com/ekliptor/expressutils
- Owner: Ekliptor
- License: gpl-3.0
- Created: 2018-05-28T06:29:30.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T06:30:43.000Z (about 8 years ago)
- Last Synced: 2025-02-22T11:26:21.573Z (over 1 year ago)
- Topics: express, express-middleware, expressjs, mongodb, nodejs, webapp
- Language: TypeScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# expressutils
Helper functions for the Express framework (expressjs.com) to render templates, write meta tags, perform localization, implement REST APIs and more.
## Installation
```
npm install @ekliptor/expressutils
```
## Usage
At the top of your source code file write:
with TypeScript:
```
import * as xutils from "@ekliptor/expressutils";
```
with JavaScript:
```
const xutils = require("@ekliptor/expressutils");
```
Now you can process requests with the Responder class of this module
```
router.get('/myRoute', (req, res, next) => {
let page = new MyPage(req, res, next);
page.sendMyResponse();
});
class VpnPage extends xutils.Responder {
constructor(req, res, next) {
super(req, res, next)
}
public sendMyResponse() {
// do something....
// this.req, this.res, this.next is available
// plus lot's of helper functions
}
}
```