前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >nodejs服务器anywhere简介

nodejs服务器anywhere简介

作者头像
deepcc
发布2018-05-16 16:00:15
1.5K0
发布2018-05-16 16:00:15
举报
文章被收录于专栏:deepcc

一句话:随时随地将你的当前目录变成一个静态文件服务器的根目录。

安装

npm install anywhere -g

执行

$ anywhere // or with port

$ anywhere -p 8000 // or start it but silent(don't open browser)

$ anywhere -s // or with hostname

$ anywhere -h localhost -p 8888 // or with folder $ anywhere -d ~/git/anywhere // or enable html5 history

$ anywhere -f /index.html 帮助

$ anywhere --help Usage: anywhere --help // print help information anywhere

// 8000 as default port, current folder as root anywhere 8888

// 8888 as port anywhere -p 8989 // 8989 as port anywhere -s

// don't open browser anywhere -h localhost

// localhost as hostname anywhere -d /home

// /home as root anywhere -f /index.html

// Enable html5 history,the index is /index.html

访问

http://localhost:8000

执行命令后,默认浏览器将为您自动打开主页。

许可证

The MIT license.

PS:先安装nodejs是先决条件

npm地址:https://www.npmjs.com/package/anywhere

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016-08-04 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档