Router Methods

import { Get, Post, Put, Delete } from '@appt/api/router';

Appt's router methods are essentially express router methods with sugar. So first, we export every method express also does on a Capitalized pattern. Second, makes sense for us to maintain an semantic and coherent pattern, since many things here are using decorator and annotation syntax. Lets improve the PrivateRouter component a little:

import { TRouter } from '@appt/api';
import { Get, Post } from '@appt/api/router';
extend: TRouter('/private', {
auth: {
secret: '231edfrw21g34',
ignore: ['favicon.ico', /\/back-/\/]
inject: 'MiddlewaresComponent'
export class PrivateRouter{
this.middleware = myMiddleware;
getAll(req, res, next){
res.status(200).send('Take everything!')
getById(req, res, next){
res.status(200).send(`We're gonna search by: ${}`)
@Post('/:id', this.middleware.doSomethingFirst)
getById(req, res, next){