Skip to content

TypeScript decorators for a REST Api (using expressJS)

Notifications You must be signed in to change notification settings

zwisler-a/rest-decorators

Repository files navigation


Typescript decorators


REST-Server using Typescript decorators


Typescript decorators

Typescript - Decorators - IoC - Dependency Injection

An adaption of the express framework working with typescript decorators. Implements dependency injection to help structure a server created with it. (A way worse version of nestjs)

Example Code

@Route({
    basePath: '/foo'
})
export class BarRoute {

    // Automaticlly sind websockets events when
    // the property gets updated
    @Live({ path: 'live' }) 
    public liveData;

    // Expose REST-Endpoint
    @Endpoint()
    foo() {return "bar";}
}

@Server({
    routes: [BarRoute],
    providers: [FooService]
})
class MyServer {}

Brige.bootstrap(MyServer);

About

TypeScript decorators for a REST Api (using expressJS)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published