Integrate hugo static generator
This commit is contained in:
25
backend/app.ts
Normal file
25
backend/app.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import express from "express";
|
||||
|
||||
const hostname = '127.0.0.1';
|
||||
const httpPort = 4080;
|
||||
|
||||
const app = express();
|
||||
|
||||
app.set('views', 'views');
|
||||
app.set('view engine', 'hbs');
|
||||
|
||||
// import morgan from 'morgan'
|
||||
// app.use(morgan('dev'));
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: false }));
|
||||
app.use(express.static('public'));
|
||||
|
||||
import mainRouter from './routes/main';
|
||||
import apiRouter from './routes/api/apiRouter';
|
||||
|
||||
app.use('/', mainRouter);
|
||||
app.use('/api', apiRouter);
|
||||
|
||||
app.listen(httpPort, () => {
|
||||
console.log(`Server running at http://${hostname}:${httpPort}/`);
|
||||
});
|
Reference in New Issue
Block a user