1.2.1 • Published 11 months ago

@smsnm/bookit v1.2.1

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

BOOKit Logotype

npm.io npm.io npm.io

Description

This project will allow you to quickly set up backend services in TypeScript. The main point is to use decorators to automatically declare routers and paths.

How to use

  1. Install BOOKit as dependency
    • By npm: npm i @smsnm/bookit
    • By yarn: yarn add @smsn/bookit
    • By pnpm: pnpm add @smsn/bookit
  2. Write a class to be used as a router:

    import { Router } from '@smsnm/bookit';
    
    @Router()
    export default class MainRouter {}
  3. Add method with decorator (for example GET):

    import { Router, Get } from '@smsnm/bookit';
    
    @Router()
    export default class MainRouter {
    
       @Get()
       hello() {
          return '<h1>Hello, BOOKit!</h1>';
       }
    }
  4. In main script initialize common class and add the router:

    import { Bookit } from '@smsnm/bookit';
    import MainRouter from 'path/to/router';
    
    const kit = new Bookit();
    kit.addRouters(MainRouter);
    kit.start(7910, 'Server started!');
  5. Run!

Documentation

Documentation can be found at: https://samsonium.github.io/bookit/ This is a temporary documentation, which, in the future, will be replaced by the normal 🙃

Contributing

Contribution guide is under development...

1.2.1

11 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago