An open API service indexing awesome lists of open source software.

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

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)