forked from Animesh606/WeatherForcasting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (24 loc) · 785 Bytes
/
index.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
// https://api.openweathermap.org/data/2.5/weather?q={city name}&appid={API key}
// https://api.openweathermap.org/data/2.5/weather?q=ghatal&appid=ed933036b1742e5819eb041550a0d671
const express = require("express");
const ejs = require("ejs");
const app = express();
app.set("view engine" , "ejs");
app.use(express.static(__dirname + '/public'));
const port = process.env.PORT || 8000;
app.get("/",(req, res) => {
res.status(200).render("home")
}
)
// app.get("/home.css",(req,res)=>{
// res.status(200).render("home.css");
// })
// app.get("/home.js",(req,res)=>{
// res.status(200).render("home.js")
// })
app.use((req,res,next)=>{
res.send('<h1> Error 404 <\h1>');
})
app.listen(port, () => {
console.log(`Server is listening on ${port}`);
});