2016-08-17 03:56:08 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var express = require('express');
|
|
|
|
var router = express.Router();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Home
|
|
|
|
*/
|
|
|
|
router.get('/', (req, res) => {
|
2016-08-20 04:50:29 +00:00
|
|
|
|
|
|
|
var Promise = require('bluebird');
|
|
|
|
var fs = Promise.promisifyAll(require("fs"));
|
2016-08-20 21:20:53 +00:00
|
|
|
|
2016-08-23 04:25:36 +00:00
|
|
|
fs.readFileAsync("repo/Storage/Redis.md", "utf8").then(function(contents) {
|
2016-08-20 21:20:53 +00:00
|
|
|
let pageData = mark.parse(contents);
|
|
|
|
if(!pageData.title) {
|
2016-08-23 04:25:36 +00:00
|
|
|
pageData.title = 'Redis';
|
2016-08-24 01:09:09 +00:00
|
|
|
pageData.subtitle = 'An open source, in-memory data structure store, used as database, cache and message broker.';
|
2016-08-20 21:20:53 +00:00
|
|
|
}
|
|
|
|
res.render('pages/view', { pageData });
|
2016-08-20 04:50:29 +00:00
|
|
|
});
|
|
|
|
|
2016-08-17 03:56:08 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|