https://github.com/techwritescode/promenade
A modern router for Node.JS
https://github.com/techwritescode/promenade
Last synced: 12 months ago
JSON representation
A modern router for Node.JS
- Host: GitHub
- URL: https://github.com/techwritescode/promenade
- Owner: techwritescode
- Created: 2018-05-15T01:05:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-18T12:59:49.000Z (about 8 years ago)
- Last Synced: 2025-06-29T19:30:43.209Z (12 months ago)
- Language: TypeScript
- Homepage: https://simonhochrein.github.io/promenade
- Size: 226 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Install
Install using yarn
```bash
$ yarn add https://github.com/simonhochrein/promenade
```
Or npm
```bash
$ npm i https://github.com/simonhochrein/promenade
```
## Example
```
├──routes
│ └──main.ts
├──server.ts
└──tsconfig.json
```
tsconfig.json
```json
{
"compilerOptions": {
"outDir": "./dist",
"target": "es5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es6"
]
}
}
```
server.ts
```typescript
import * as http from 'http';
import "promenade/auto";
autoload(__dirname, "routes/*.js");
http.createServer(Server()).listen(8888);
```
routes/main.ts
```typescript
@Router()
class Main {
@Get("/")
Index() {
Response.Send("Hello World!");
}
}
```
### Running
```bash
$ tsc
$ cd dist
$ node server.js
```
## [Documentation](https://simonhochrein.github.io/promenade)