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();
|
2022-10-17 12:58:30 +02:00
|
|
|
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
|
|
|
|
2022-10-17 12:58:30 +02:00
|
|
|
app.listen(port, () => {
|
|
|
|
console.log('✅ Webserver started on port ', port)
|
|
|
|
})
|