Support TS, swagger,Template(xls,docx),PDF convert

This commit is contained in:
Sorawit Bholsithi 2023-10-07 17:29:53 +07:00
parent b221deb1cf
commit 8d7654423a
84 changed files with 3604 additions and 1 deletions

27
app.ts Normal file
View file

@ -0,0 +1,27 @@
/*
* Report Server
* Web API Path
* Node.js reverse proxy pandoc swan
* demo frontent public
*/
import swaggerspecs from "./libs/swagger-specs.json"
import swaggerUi from "swagger-ui-express"
import express, { Express, Request, Response } from 'express'
import { docxTemplateRoute } from './libs/docx-templates-lib'
import { xlsxTemplateRoute } from './libs/xlsx-template-lib'
import { convertTemplateRoute } from './libs/convert-libs'
const app: Express = express()
const port: number = Number(process.env.PORT) || 80;
app.use(express.json()); //application/json
app.use(express.raw()); //application/octet-stream
app.use(express.urlencoded({ extended: true }));
app.use("/swagger", swaggerUi.serve, swaggerUi.setup(swaggerspecs,{ explorer: true }));
app.get('/', (req: Request, res: Response) => {
res.json({
message: 'Hello report-template API !!',
})
})
app.use('/api/v1/report-template/docx', docxTemplateRoute);
app.use('/api/v1/report-template/xlsx', xlsxTemplateRoute);
app.use('/api/v1/report-template/convert', convertTemplateRoute);
app.listen(port, () => console.log(`Application is running on port ${port}`))