mblog
v0.0.4
Published
bulit your blog with node.js
Downloads
3
Readme
MBlog
built your blog or website in node.js
var app = require('mblog');
app.start('9999');
Static files
all the static files (.) are in the folder /static
eg: 127.0.0.1:9999/test.js
=> /static/test.js
MIME
the default MIME is:
MIME = {
'css' : 'text/css',
'js' : 'text/javascript',
'gif' : 'image/gif',
'jpg' : 'image/jpeg',
'png' : 'image/png',
'ico' : 'image/x-icon',
'html' : 'text/html',
'htm' : 'text/html',
'txt' : 'text/plain',
'mp4' : 'video/mp4'
};
if you want add or remove some MIME,you can simple use:
add .exe file support
app.mime.add({"exe":"plan/application"})
remove .css file support
app.mime.remove("css")
remove .css and .javascript file support
app.mime.remove("css,javascript")
Dynamic url
if access a dynamic url (not end with .);
for example,if you visite a url name.com/abc/dd
mblog first try to read /abc/dd/index.js
file,if the file is exists run this file,if it's not exists,mblog will try to read /abc/dd/index.html
,if it's not exists again,mblog will return 404 pages
name.com/abc/dd
=>/abc/dd/index.js
|/abc/dd/index.jade
####HTML Templpate
In mblog we use Jade to readen html,is easy and simple
you also can use jade's layout to finish you pages