This repository was archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
39 lines (31 loc) · 1.19 KB
/
server.js
File metadata and controls
39 lines (31 loc) · 1.19 KB
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
var bodyParser = require('body-parser');
const puppeteer = require("puppeteer");
const express = require("express");
const app = express();
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
PORT = process.env.PORT || 3000;
// all routes come here
const getScores = require('./routes/getmarks.js');
const getAttendance = require('./routes/getattendance.js');
const getProfile = require('./routes/getprofile.js');
const validateUSER = require('./routes/validateuser.js');
//for getting marks of all the subjects
app.all("/getscores", getScores);
// for getting attendances of all subjects
app.all("/getattendance", getAttendance);
//for getting profile of person
app.all("/getprofile", getProfile);
//for gettting user credentials validations
app.all("/validateuser", validateUSER);
//for all other requests
app.get("*", function (req, res) {
console.log("Invalid request format was sent");
res.send("Invalid URL format. Read the documentations.");
});
app.listen(PORT, async function () {
console.log("The server is now listening on port", PORT);
browser = await puppeteer.launch();
newPage = await browser.newPage();
console.log("Reached Here: Browser Open");
});