My first web project with Node.js
来源:互联网 发布:魔豆计划软件 编辑:程序博客网 时间:2024/05/08 19:15
var http = require("http");
var fs = require("fs");
var server = http.createServer(function(request, response){
console.log("Received request:" + request.url);
fs.readFile("./public" + request.url, function(error, data) {
if(error) {
response.writeHead(404, {"Content-type":"text/plain"});
response.end("Sorry the page was not found");
} else {
response.writeHead(200, {"Content-type":"text/html"});
response.end(data);
}
});
});
server.listen(8888);
console.log("Server is running....");
0 0
- My first web project with Node.js
- My first DLL project
- congratulations on my first project in weblogic
- Greedy Snake In Java ----My First Project
- My first memo at web.
- My first mobile web app
- [Not Mine] My weekend project: an Arduino, Raspberry Pi & Node.js robot
- js+html(my first lesson)
- First Project ——Web
- My first test entry with CSDN
- The first Spring project with Ioc
- Cordova in action学习笔记二:My First Project
- Code Project - Your First C# Web Service
- Node.js Web模块
- Node.js web
- Node.js Web模块
- Node.js Web模块
- Node.js Web 模块
- Oracle存储过程基本语法和基础教程
- Method Class.getMethod(String name, Class... parameterTypes)
- nyoj题目11:奇偶数分离
- Swift 中AFNetworking 的替代方案 Alamofire
- ExecutorCompletionService
- My first web project with Node.js
- Java取昨天、今天和明天的日期并格式化
- Eclipse从SVN checkout并创建项目
- Java EE 7 教程 第一部分 简介 第1章 概述 第1.2节 Java EE 应用模型
- Mongodb 学习笔记
- 1089 A+B for Input-Output Practice (I)
- 第十五周项目3(4)OJ上玩指针
- linux 书籍
- ’alter system set 参数=XX‘命令的本质以及参数文件中SID和*两类前缀名优先级