You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Sambo Chea 90b48a661a Update 'README.md' 2 months ago
.husky Initial commit 3 months ago
src Add cubetiq express server module for nodejs 3 months ago
.drone.yml Updated format 3 months ago
.eslintrc.js Updated format 3 months ago
.gitignore Initial commit 3 months ago
.prettierrc.json Initial commit 3 months ago
LICENSE Initial commit 3 months ago
README.md Update 'README.md' 2 months ago
package.json Add cubetiq express server module for nodejs 3 months ago
tsconfig.json Updated format 3 months ago

README.md

CUBETIQ Express Server

Build Status

  • Express
  • TypeScript
  • Decorators

Getting Start

  • Add code into your index.ts
import "reflect-metadata"

import { createServer } from "http"
import server from "./server"

const app = server.instance
const httpServer = createServer(app)

httpServer.listen(process.env.PORT || 3000, () => {
    console.log(`Server listening on port: 3000`)
})
  • Create server.ts
import { Request, Response } from "express"
import { Application } from "./application"
import { Controller, Get } from "./decorators"

@Controller("/index")
class IndexController {
    @Get()
    public async index(req: Request, res: Response) {
        res.json({
            status: 200,
        })
    }
}

class Server extends Application {
    get controllers(): any[] {
        return [IndexController]
    }
}

export default new Server()

Contributors