-
Notifications
You must be signed in to change notification settings - Fork 1
Getting started
Azuwey edited this page Feb 28, 2018
·
3 revisions
$ yarn add quartzfw
$ npm install quartzfw --save-prod
This is our express host. @ServerDecorator
import { ServerDecorator } from 'quartzfw';
import Application from './application.module';
@ServerDecorator({
application: Application,
})
export default class Server {}
This is our express application, here you can access the express application with the @AppDecorator //TODO: LINK TO MODULE DECORATOR
import { ModuleDecorator } from 'quartzfw';
import IndexController from './controllers/index.controller';
@ModuleDecorator({
controllers: [ IndexController ],
})
export default class ApplicationModule {}
This is our controller, this handles our endpoints. //TODO: LINK TO CONTROLLER DECORATOR
import { Request, Response } from 'express';
import { ControllerDecorator, GetDecorator } from 'quartzfw';
@ControllerDecorator()
export default class IndexController {
@GetDecorator()
private test(req: Request, res: Response) {
res.send('Hello from QuartzFW')
}
}