2.6.4 • Published 11 months ago

@wellenline/via v2.6.4

Weekly downloads
6
License
MIT
Repository
github
Last release
11 months ago

Via

Via

Simple, lightwieght & dependency free HTTP routing framework

Build Status

Installation

$ npm add @wellenline/via

Basic Example

import { bootstrap, Resource, Get, app } from "@wellenline/via";

@Resource()
export class Hello {
	@Get("/hello")
	public async index() {
		return {
			hello: "world"
		};
	}
}

bootstrap({
	port: 3000,
});

Examples

Hooks (middleware)

@Before((context: IContext) => void)
import { bootstrap, Resource, Get, app, IContext } from "@wellenline/via";

@Resource("/path", { version: "v1" })
export class Hello {
	@Get("/hello/:hello")
	@Before(async (context: IContext) => {
		return context.params.hello === "world"; // continue if hello === world
	);
	public async index() {
		return {
			hello: "world"
		};
	}
}

bootstrap({
	port: 3000,
});
2.6.4

11 months ago

2.6.1

11 months ago

2.6.3

11 months ago

2.5.0

2 years ago

2.6.0

2 years ago

2.4.0

2 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

1.1.5

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago