-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (23 loc) · 807 Bytes
/
app.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
import express from 'express'
import path from "path"
import bodyParser from 'body-parser'
import { fileURLToPath } from 'url';
var app = express()
app.use(express.json());
app.use(express.urlencoded({ extended: true }))
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
app.set('views',path.join(__dirname, 'views'));
app.set('view engine','ejs');
app.use(express.static(path.join(__dirname, 'public')));
import users from './models/db.js'
app.get("/",function(req,res){
return res.send("This is the Home page")
})
app.get("/login_page",function(req,res){
return res.render('login_reg')
})
import UserReg from "./controllers/users.js"
app.post("/register",UserReg.userRegistration);
app.post("/login_in",UserReg.userLogin);
app.listen(3000)