mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-27 01:36:28 +00:00
fix(markdown) set root when reletive path
This commit is contained in:
parent
17d6efff4d
commit
3e85d3314f
1 changed files with 3 additions and 3 deletions
|
|
@ -8,8 +8,7 @@
|
|||
fs = require('fs'),
|
||||
|
||||
Util = require(DIR_LIB + 'util'),
|
||||
config = require(DIR + 'config'),
|
||||
mellow = require('mellow'),
|
||||
root = require('root'),
|
||||
pipe = require('pipe-io'),
|
||||
ponse = require('ponse'),
|
||||
markdown = require('markdown-it')();
|
||||
|
|
@ -21,11 +20,12 @@
|
|||
switch(method) {
|
||||
case 'GET':
|
||||
name = name.replace('/markdown', '');
|
||||
name = mellow.pathToWin(name, config('root'));
|
||||
query = ponse.getQuery(request);
|
||||
|
||||
if (query === 'relative')
|
||||
name = DIR_ROOT + name;
|
||||
else
|
||||
name = root(name);
|
||||
|
||||
fs.readFile(name, 'utf8', function(error, data) {
|
||||
if (error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue