Go to file
2021-09-16 17:49:43 +07:00
.husky Initial commit 2021-09-16 17:23:07 +07:00
src Add cubetiq express server module for nodejs 2021-09-16 17:49:43 +07:00
.drone.yml Initial commit 2021-09-16 17:23:07 +07:00
.eslintrc.js Initial commit 2021-09-16 17:23:07 +07:00
.gitignore Initial commit 2021-09-16 17:23:07 +07:00
.prettierrc.json Initial commit 2021-09-16 17:23:07 +07:00
LICENSE Initial commit 2021-09-16 17:23:07 +07:00
package.json Add cubetiq express server module for nodejs 2021-09-16 17:49:43 +07:00
README.md Add cubetiq express server module for nodejs 2021-09-16 17:49:43 +07:00
tsconfig.json Add cubetiq express server module for nodejs 2021-09-16 17:49:43 +07:00

CUBETIQ Express Server

  • 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