-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (27 loc) · 835 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
const express=require("express")
const app=express();
const port= process.env.PORT || 3000;
const path = require("path");
// const hbs=require("hbs");
const staticPath = path.join(__dirname, "./public");
// const view = path.join(__dirname, "../templates/views");
// const particalPath = path.join(__dirname, "../templates/partials");
// app.set('view engine', 'hbs');
// app.set("views", view);
// hbs.registerPartials(particalPath);
app.use(express.static(staticPath));
app.get("/",(req,res)=>{
res.render('index')
})
app.get("/about*",(req,res)=>{
res.send('about')
})
app.get("/weather",(req,res)=>{
res.render('welcome to weather')
})
// app.get("*",(req,res)=>{
// res.render("welcome to login")
// })
app.listen(port,()=>{
console.log(`listening to the ${port}`);
})