server.js
532 Bytes
const express = require('express');
const router = express.Router();
const fs = require('fs');
const path = require('path');
const PORT = 80;
const app = express();
app.use(express.json())
app.use(express.urlencoded({extended: true}))
app.use(express.static(path.join(__dirname,'/public')))
app.use(router);
const indexRouter = require('./routes/root');
router.get('/', indexRouter);
app.listen(PORT,function(err){
if(err){
console.log(err);
}else{
console.log('server is running on '+ PORT);
}
})