码迷,mamicode.com
首页 > 其他好文 > 详细

使用git bash 代替cmd

时间:2015-10-30 10:32:12      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

上一文章,用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

技术分享

 

使用git bash 代替cmd

标签:

原文地址:http://www.cnblogs.com/tinyphp/p/4922315.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!