https://172.16.2.149/svn/ChinaeduCloudStatic 成教svn
    http://172.16.2.149:888/#/meta/list 成教开发环境

    http://172.16.4.87:8080/framework-web-conf/login.jsp#/ 成教配置中心

    http://172.16.2.149:8090/ 成教Jenkins发版地址

    image.png

    image.png

    先在dev上修改,开发环境验过了,合并trunk测试环境,要上线的任务合并到labs

    新的server.js

    1. var http=require("http");
    2. var url = require("url");
    3. var fs = require("fs");
    4. var libPath = require("path");
    5. var virtualpath = 'web-public-static/'
    6. function serverRole(req, res){
    7. var req_path = url.parse(req.url).path.replace(virtualpath,'').replace(/\?.*$/,'');
    8. var filepath = __dirname + req_path;
    9. if (req_path.indexOf('/bbs/') == 0) {
    10. filepath = 'F:/ChinaeduCloudStatic/branches/dev' + req_path;
    11. }
    12. var ext = libPath.extname(filepath);//返回文件的扩展名
    13. var contentType = "";
    14. switch(ext){
    15. case ".html":
    16. contentType= "text/html";
    17. break;
    18. case ".js":
    19. contentType="text/javascript";
    20. break;
    21. case ".css":
    22. contentType="text/css";
    23. break;
    24. case ".gif":
    25. contentType="image/gif"
    26. break;
    27. case ".jpg":
    28. contentType="image/jpeg";
    29. break;
    30. case ".png":
    31. contentType="image/png";
    32. break;
    33. case ".ico":
    34. contentType="image/icon";
    35. break;
    36. default:
    37. contentType="application/octet-stream";
    38. }
    39. fs.exists(filepath, function(exists){
    40. if(exists){
    41. fs.stat(filepath, function(err, stats){//检查一个文件是否存在
    42. if(err){
    43. res.writeHead(500, {'Content-Type' : 'text/html;charset=utf8'});
    44. res.end('<div styel="color:black;font-size:22px;">server error</div>');
    45. }else{
    46. if(stats.isFile()){
    47. var file = fs.createReadStream(filepath);
    48. res.writeHead(200, {'Content-Type' : contentType});
    49. file.pipe(res);
    50. }else{
    51. fs.readdir(filepath, function(err, files){
    52. var str = '';
    53. for(var i in files){
    54. str += files[i] + '<br/>';
    55. }
    56. res.writeHead(200, {'Content-Type' : 'text/html;charset=utf8'});
    57. res.write(str);
    58. });
    59. }
    60. }
    61. });
    62. }else{
    63. res.writeHead(404, {'Content-Type' : 'text/html;charset=utf8'});
    64. res.end('<div styel="color:black;font-size:22px;">404 not found</div>');
    65. }
    66. });
    67. }
    68. var server = http.createServer(serverRole);
    69. var server2 = http.createServer(serverRole);
    70. server.listen('80', '127.0.0.1');//测试
    71. server2.listen('1888','127.0.0.1');//开发 + bbs