const express = require('express'); const path = require('path'); const app = express(); app.engine('art', require('express-art-template')) app.set('views', path.join(__dirname)) app.set('view engine', 'art'); app.get('/index', (req, res) => { res.render('index1', { msg: 'message' }) }) app.get('/list', (req, res) => { res.render('list1', { msg: 'list page' }) }) app.listen(3000); console.log('服务器启动成功');