f2e-node-server
Version:
a nodejs based file-system-server with easy-template-engine and several F2E-utils
19 lines (14 loc) • 550 B
JavaScript
;
var fs = require('fs'),
path = require('path'),
upload = require('./upload'),
mini = require("./../filter/middleware").mini;
var configPath = path.join( __dirname, "/../html/config.html" );
exports.execute = function(req, resp, root, handle, conf){
if( req.method === "POST" ){
upload.execute(req,resp,root,handle,conf,configPath);
}else{
resp.writeHead(200, {'content-type': 'text/html'});
handle.execute(req,resp,root, fs.readFileSync( configPath, 'utf-8'), mini, true, conf);
}
};