-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
37 lines (31 loc) · 876 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
37
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var passport=require("passport");
var methodOverride= require("method-override");
var path = require('path');
app.use(bodyParser.urlencoded({extended: true}));
app.set("view engine", "ejs");
app.use(express.static(__dirname+"/public"));
app.use(methodOverride("_method"));
app.get("/", function(req, res){
res.render("index");
});
app.get("/login", function(req, res){
res.render("login");
});
app.get("/signup", function(req, res){
res.render("signup");
});
app.post("/signup", function(req, res){
res.redirect("/maps");
});
app.post("/login", function(req, res){
res.redirect("/maps");
});
app.get("/maps", function(req, res){
res.sendFile(path.join(__dirname + '/MapAndLoc.html'));
});
app.listen(3000, function(){
console.log("Ehtihaad Bartein ~(^_^)~");
});