forked from awesome-yasin/PDF-Verse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
43 lines (40 loc) · 1.4 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const express = require('express')
const bodyParser = require('body-parser')
const mergeRouter = require('./routes/merge');
const splitRouter = require('./routes/split');
const editorRouter = require('./routes/editor');
const watermarkRouter = require('./routes/watermark');
const deleteRouter = require('./routes/delete');
const pageNoRoute = require('./routes/pageno');
const rotateRoute = require('./routes/rotatepdf');
const pdfToWord = require('./routes/pdftoword');
const compressRoute = require('./routes/compress');
const pdfToExcel = require('./routes/pdftoexcel');
const pdfToPpt = require('./routes/pdftoppt')
const pdfToPng = require('./routes/pdftopng')
const cors = require('cors');
const app = express();
const path = require('path');
app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.urlencoded({ extended: true }));
app.set('views', path.join(__dirname, '/views'))
app.set('view engine', 'ejs')
app.use(express.static(path.join(__dirname, 'public')));
app.use(mergeRouter);
app.use(splitRouter);
app.use(editorRouter);
app.use(watermarkRouter);
app.use(deleteRouter);
app.use(pageNoRoute);
app.use(rotateRoute);
app.use(pdfToWord);
app.use(compressRoute);
app.use(pdfToExcel);
app.use(pdfToPpt);
app.use(pdfToPng);
app.use(express.static(path.join(__dirname, 'public')));
app.listen(8080, () => {
console.log('Server is running on port 8080');
});