-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (20 loc) · 738 Bytes
/
app.js
File metadata and controls
25 lines (20 loc) · 738 Bytes
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
const express=require('express')
const app = express()
const path = require('path')
require('dotenv').config()
// For Post Requests
app.use(express.urlencoded({extended:false}))
app.use(express.json())
console.log(__dirname);
// For Static Routes
app.set('view engine','ejs');
app.use('/CSS', express.static(__dirname + '/Public/CSS'))
app.use('/JS', express.static(__dirname + '/Public/JS'))
app.use('/Assets', express.static(__dirname+'/Public/Assets'))
// For Navigation
app.use('/', require('./Routes/homeRoute'))
app.use('/sendMail', require(path.join(__dirname+'/Routes/sendMail')))
// Initiating Backend on port (3000)
app.listen(process.env.PORT, ()=>{
console.log(`Server started at port ${process.env.PORT}.......`);
})