Go to file
Phan Kongsamarch dc8f27ae0a remove eslint jsdoc 2023-05-06 10:43:09 +07:00
.github Create dependabot.yml 2021-09-26 18:54:22 +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 Updated format 2021-09-16 18:17:48 +07:00
.eslintrc.js remove eslint jsdoc 2023-05-06 10:43:09 +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 remove eslint jsdoc 2023-05-06 10:43:09 +07:00
README.md Update 'README.md' 2021-09-26 20:55:50 +07:00
tsconfig.json Updated format 2021-09-16 18:17:48 +07:00

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