server.js 648 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');
const fetchNoticeList = require('./routes/api/fetchNoticeList');

router.get('/', indexRouter);
router.post('/api/fetchNoticeList', fetchNoticeList);

app.listen(PORT,function(err){
    if(err){
        console.log(err);
    }else{
        console.log('server is running on '+ PORT);
    }
})