server.js
543 Bytes
const express = require('express');
const app = express();
const config = require('./init/config');
//markdown主题
app.use(express.static(__dirname + '/themes'));
const MdAction = require('./lib/md-action');
let base_path = config.md.base_path || {};
Object.keys(base_path).forEach(p => {
app.use('/', new MdAction(p, base_path[p]))
});
//默认
app.use('/', new MdAction('/', 'md'));
const PORT = config.system.bind_port;
app.listen(PORT);
console.info(`Server is started up by binding ${PORT}. Visit http://localhost:${PORT}`);