您的位置:首页 > 运维架构 > Shell

使用git bash 代替cmd

2015-10-30 09:44 651 查看
上一文章,用Node.js建HTTP服务器,然后在cmd启动,这次尝试用git bash。

git bash 也是命令行工具,画面更好看,使用更方便,可以替代cmd。

下载git:https://git-for-windows.github.io/

安装省略....

第一步:打开Git Bash,输入代码,获取实例文件:

git clone git://github.com/angular/angular-phonecat.git


第二步:启动

npm start


第三步,F盘创建tinyphp.js

var http = require('http');

http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/'); 复制代码


第四步:在F盘下运行node tinyphp.js



然后打开浏览器访问: http://127.0.0.1:1337
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: