洛羿莎麦

导航

app.js ejs 转换为html

var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');



var routes = require('./routes/index');
var users = require('./routes/users');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));

app.engine('.html', require('ejs').renderFile);  

app.set('view engine', 'html');  

亲测好用
其他的与ejs相同

posted on 2016-02-19 14:15  洛羿莎麦  阅读(516)  评论(0编辑  收藏  举报