18 lines
395 B
TypeScript
18 lines
395 B
TypeScript
import Koa from 'koa'
|
|
import dotenv from 'dotenv'
|
|
import route from 'koa-route'
|
|
import Debug from 'debug'
|
|
|
|
dotenv.config()
|
|
console.log = Debug('invoiceIssuer:app.ts')
|
|
|
|
const app = new Koa()
|
|
|
|
app.use(route.get('/', (ctx) => {
|
|
ctx.body = 'Hello World'
|
|
}))
|
|
|
|
const port = parseInt(process.env.PORT ?? '3000')
|
|
app.listen(port, () => {
|
|
console.log(`Server is running at http://localhost:${port}`)
|
|
}) |