candlelight

1.0.0-alpha.27 • Public • Published

Candlelight

A NodeJs Web Framework

Installation

npm install candlelight --save

Usage with Restful

import Application from 'candlelight/Application';
import RestController from 'candlelight/annotation/RestController';
import RequestMapping from 'candlelight/annotation/RequestMapping';
import HttpMethod from 'candlelight/http/HttpMethod';

@RestController
class ApplicationController{
    @RequestMapping({value: '/index', method: HttpMethod.GET})
    index(ctx){
        return {
            success: true,
            message: 'Hello World!'
        };
    }
}

const app = new Application();
app.run({
    controllers: {
        ApplicationController
    }
});

Middleware

const app = new Application();
app.

Request Params

path variable

class Controller{
    
    @RequestMapping({path: '/:id'})
    index({pathVariable}){
        const {id} = pathVariable;
    }
}

Readme

Keywords

Package Sidebar

Install

npm i candlelight

Weekly Downloads

1

Version

1.0.0-alpha.27

License

ISC

Last publish

Collaborators

  • happysuns
  • sean-tian