C++builder 调用 DLL,该怎么解决
2个回答
2015-12-03
展开全部
fs.exists(localPath, function (exists) {
if (exists) {
if (staticRes) {
staticResHandler(localPath, ext, response); //静态资源
} else {
try {
var handler = require(localPath);
if (handler.processRequest && typeof handler.processRequest === 'function') {
handler.processRequest(request, response); //动态资源
} else {
response.writeHead(404, { 'Content-Type': 'text/plain' });
response.end('404:Handle Not found');
}
} catch (exception) {
console.log('error::url:' + request.url + 'msg:' + exception);
response.writeHead(500, { "Content-Type": "text/plain" });
response.end("Server Error:" + exception);
}
if (exists) {
if (staticRes) {
staticResHandler(localPath, ext, response); //静态资源
} else {
try {
var handler = require(localPath);
if (handler.processRequest && typeof handler.processRequest === 'function') {
handler.processRequest(request, response); //动态资源
} else {
response.writeHead(404, { 'Content-Type': 'text/plain' });
response.end('404:Handle Not found');
}
} catch (exception) {
console.log('error::url:' + request.url + 'msg:' + exception);
response.writeHead(500, { "Content-Type": "text/plain" });
response.end("Server Error:" + exception);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询