七牛---詳解Ufop部署情況

很多用戶不知道怎麼部署成功一個Ufop,這裏詳細介紹下如何跑通一個Ufop,關於Ufop的文檔可以參考:
http://developer.qiniu.com/article/dora/ufop/ufop-introduction.html

這裏直接給出一個Node.js的部署的代碼:

var http = require('http');
var url = require('url');

console.log('hello ufop');

http.createServer(function(req, res) {  
    console.log('req', req);
    var path = url.parse(req.url).pathname;
    var dt = new Date();
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.write("Hello,World ! \n" + dt.getTime());
    res.end();
}).listen(9100, "0.0.0.0");

console.log('access:http://0.0.0.0:9100');

具體源碼也可以參考:
https://github.com/Qiniu-Ts/NodejsUfop/tree/master

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章