feat: add route to retrieve invoice details by ID and suffix
This commit is contained in:
parent
ac53c3c6cf
commit
520b191da0
|
@ -143,6 +143,10 @@ app.use(route.post('/invoice', async (ctx) => {
|
||||||
ctx.status = 204
|
ctx.status = 204
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
app.use(route.get('/invoice/INV-:date(\\d{8})-:suffix(\\d+)', async (ctx, invoiceId, suffix) => {
|
||||||
|
ctx.body = `Invoice ID: INV-${invoiceId}-${suffix}`
|
||||||
|
}))
|
||||||
|
|
||||||
const port = parseInt(process.env.PORT ?? '3000')
|
const port = parseInt(process.env.PORT ?? '3000')
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
console.log(`Server is running at http://localhost:${port}`)
|
console.log(`Server is running at http://localhost:${port}`)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user