MangoRecipe/Source/Webserver/index.ts

21 lines
550 B
TypeScript
Raw Normal View History

2022-10-17 11:56:45 +02:00
import express from "express";
2022-10-18 12:30:12 +02:00
import { Liquid } from "liquidjs";
const engine = new Liquid();
const app = express();
const port = 3430;
2022-10-18 12:30:12 +02:00
app.engine('liquid', engine.express());
app.set('views', ['./partials', './views']);
app.set('view engine', 'liquid');
app.get('/', function (req, res) {
const todos = ['fork and clone', 'make it better', 'make a pull request']
res.render('todolist', {
todos: todos,
title: 'Welcome to liquidjs!'
})
})
2022-10-17 11:56:45 +02:00
app.listen(port, () => {
console.log('✅ Webserver started on port ', port)
})