-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
20 lines (16 loc) · 774 Bytes
/
app.js
File metadata and controls
20 lines (16 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const app = require('express')();
const chalk = require('chalk');
const bodyParser = require('body-parser');
const parsePDF = require('./controller/pythonFunctionCall');
const debugMiddleware = require('./debugMiddleware');
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }));
// parse application/json
app.use(bodyParser.json());
//route for add
//if got a and b in request than added else warning will be send
app.post('/parsePDF', debugMiddleware.printReq ,parsePDF);
app.get('/getTest', debugMiddleware.printReq, (req, res) => {res.send('done')});
app.listen(3000, () => {
console.log(chalk.blue("server starts working.") + " You can access it on url : " + chalk.yellow.bold("http://localhost:3000/parsePDF"));
});