-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
62 lines (50 loc) · 1.66 KB
/
index.js
File metadata and controls
62 lines (50 loc) · 1.66 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const registerServices = require("./services/registerServices");
const loginService = require("./services/loginService");
var express = require('express');
var http = require('http');
const dbutility = require("./services/dbutility");
const forgotService = require("./services/forgotService");
//var http = require('url');
//var http = require('http');
var app = express();
var port = process.env.port || 4200;
app.use(express.static(__dirname + '/'));
app.use(express.json());
app.get('/', (req, res) => res.sendFile('/index.html'));
var server = http.createServer(app);
server.listen(port, () => console.log('Asset Naming Assistant Running on : ', port));
app.get('/testEndPoint', function (req, res) {
var response = {
"response": "Asset Naming Assistant is running"
};
res.json(response);
});
app.get('/testdb', function(req, res) {
console.log("I'm here");
dbutility.getInstanceBySiteId()
.then(function(response){
console.log(response)
// res.send(response)
}).catch(function(error){
console.log(error);
})
});
app.post('/login_user', function(req, res){
loginService.checklogin(req.body)
.then(function(response){
console.log(response)
res.send(response)
}).catch(function(error){
console.log(error);
})
});
app.post('/register_user', function(req, res){
registerServices.userlogin(req.body)
});
app.post('/forgot_user', function(req, res){
forgotService.checkforgotusername(req.body)
});
app.get('/sucess_login', function(req, res){
//forgotService.checkforgotusername(req.body)
dbutility.get
});