26 lines
612 B
TypeScript
26 lines
612 B
TypeScript
import express, { type Request, type Response } 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 userData from './userKnowledge.json';
|
|
|
|
app.get('/', function (req: Request, res: Response) {
|
|
res.render('cv2', { userData });
|
|
});
|
|
|
|
app.listen(httpPort, () => {
|
|
console.log(`Server running at http://${hostname}:${httpPort}/`);
|
|
});
|