ethereumjs-vm的例子有用到这个

看完ethereumjs-vm,再看他ethereumjs/browser-builds,然后最后看他http-server,然后就能了解ethereumjs-vm的例子ethereumjs-vm/examples/run-transactions-simple

https://github.com/indexzero/http-server

http-server: a command-line http server一个命令行http服务器

http-server is a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning.

http-server是简单的、零配置的命令行http服务器。它足够强大,可以用于生产使用,但是它足够简单和可编程,可以用于测试、本地开发和学习

Installing globally:全局安装

Installation via npm:

 npm install http-server -g

安装的版本:

+ http-server@0.11.

This will install http-server globally so that it may be run from the command line.

这将全局安装http-server,以至于它能从命令行运行

Usage:

http-server [path] [options]

[path] defaults to ./public if the folder exists, and ./ otherwise.

[path]如果文件夹存在则默认为./public,否则为./

Now you can visit http://localhost:8080 to view your server

你可以通过访问http://localhost:8080去查看你的服务器

Note: Caching is on by default. Add -c-1 as an option to disable caching.

注意:默认情况下,缓存是打开的。添加-c-1作为乐意选项去取消缓存

Available Options:有效选项

-p or --port Port to use (defaults to 8080)  使用的端口(默认为8080)

-a Address to use (defaults to 0.0.0.0)  使用的地址(默认为0.0.0.0)

-d Show directory listings (defaults to true)  是否显示目录列表(默认为true)

-i Display autoIndex (defaults to true)  是否显示自动索引

-g or --gzip When enabled (defaults to false) it will serve ./public/some-file.js.gz in place of ./public/some-file.js when a gzipped version of the file exists and the request accepts gzip encoding.  当可用时(但是默认为false,不可用),它将会在一个文件的压缩版本存在且需要接受gzip编码时,提供./public/some-file.js.gz以代替./public/some-file.js

-e or --ext Default file extension if none supplied (defaults to html)  如果提供的是none,默认文件扩展(默认为html)

-s or --silent Suppress log messages from output  从输出中取消日志信息

--cors Enable CORS via the Access-Control-Allow-Origin header  通过Access-Control-Allow-Origin头可用CORS

-o Open browser window after starting the server  在开启服务器后自动打开浏览器

-c Set cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to 3600). To disable caching, use -c-1.  为缓存控制的最大年龄设置缓存时间(秒为单位),比如 -c10代表10秒(默认为3600)。为了取消缓存,可以使用-c-1

-U or --utc Use UTC time format in log messages. 在日志信息中使用UTC时间格式

-P or --proxy Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com   代理所有无法在本地解析到给定url的请求,比如:-P http://someurl.com

-S or --ssl Enable https. 设置https可用

-C or --cert Path to ssl cert file (default: cert.pem).  ssl证书文件路径(默认为cert.pem

-K or --key Path to ssl key file (default: key.pem).  ssl密钥文件路径(默认为key.pem

-r or --robots Provide a /robots.txt (whose content defaults to User-agent: *\nDisallow: /)  提供一个/robots.txt文件(其内容默认为User-agent: *\nDisallow: /

-h or --help Print this list and exit.  输出该列表内容并退出

Magic Files

  • index.html will be served as the default file to any directory requests. index.html将作为任何目录请求的默认文件
  • 404.html will be served if a file is not found. This can be used for Single-Page App (SPA) hosting to serve the entry page. 当一个文件找不到时,404.html将被使用。这可以用于单页面应用程序(SPA)托管来服务入口页面

Development开发

Checkout this repository locally, then:本地查看存储库

$ npm i
$ node bin/http-server

Now you can visit http://localhost:8080 to view your server

然后你就可以访问http://localhost:8080去查看你的服务器

You should see the turtle image in the screenshot above hosted at that URL. See the ./public folder for demo content.

您应该可以在上面的截图中看到这个URL上托管的乌龟图像。有关演示内容,请参见./public文件夹

运行尝试一下:

userdeMacBook-Pro:~ user$ http-server
Starting up http-server, serving ./public
Available on:
http://127.0.0.1:8080
http://192.168.1.102:8080
Hit CTRL-C to stop the server
[Sat Dec :: GMT+ (中国标准时间)] "GET /favicon.ico" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:63.0) Gecko/20100101 Firefox/63.0"
[Sat Dec :: GMT+ (中国标准时间)] "GET /favicon.ico" Error (): "Not found"

界面为:

indexzero/http-server-1-简介的更多相关文章

  1. 第三篇——第二部分——第一文 SQL Server镜像简介

    原文:第三篇--第二部分--第一文 SQL Server镜像简介 原文出处:http://blog.csdn.net/dba_huangzj/article/details/26951563 镜像是什 ...

  2. 第十六周翻译-SQL Server复制的阶梯:第1级 - SQL Server复制简介

    SQL Server复制的阶梯:第1级 -  SQL Server复制简介 作者:Sebastian Meine,2012年12月26日 翻译:赖慧芳 译文: 该系列 本文是Stairway系列的一部 ...

  3. SQL server 2008 简介

    一.简介 网状模型 关系模型(独立表) 拆分成有主键的表.连接表即可. 工资与奖金有了依赖关系.所以可以不保存奖金,计算得出结果. 二. 1. 2.环境配置 安装iis服务 https://jingy ...

  4. SQL Server 数据类型简介

    在 SELECT 的查询过程和查询结果中,每个列.变量.表达式和参数都具有一个相关的数据类型.数据类型用于指定某个对象可保存的数据的类型. SQL Server系统的数据类型主要有:数值类型.日期和时 ...

  5. Windows Server 2016-Telnet 简介及安装

    Telnet是基于请求注释(RFC)854的因特网标准程序和协议,该RFC规定了一种在网络上发送和接收未加密的ASCII字符(明文)的方法.Telnet包含两个功能模块:Telnet客户端和Telne ...

  6. Server JRE 简介

    Server JRE, 服务器版JRE JRE安装包, JDK安装包, 以及 Server JRE 压缩包, 在 Java SE Download 页面都可以下载: http://www.oracle ...

  7. [转帖]sql server版本特性简介、版本介绍简介

    sql server版本特性简介.版本介绍简介 https://www.cnblogs.com/gered/p/10986240.html 目录 1.1.sql server的版本信息 1.2.版本重 ...

  8. sql server版本特性简介、版本介绍简介

    1.SQL Server 版本简介 1.1.sql server的版本信息 年    代 版    本 大版本号 1993年 SQL Server for Windows NT 4.21 1994年 ...

  9. SQL Server Profiler使用教程,通俗易懂才是王道

    做开发,平时难免和数据库打交道,特别是写存储过程,对于我们这些不常写SQL的人来说是一件极其痛苦的事,每次写完运行总是有错,如果用的是本地数据库的话还好,可以在本机调试SQL,那如果在数据库在服务器上 ...

  10. MySQL:MySQL和SQL Server的区别

    导读:接下来的网上商城的项目,需要用到MySQL数据库了.这个对于我来说,是一个新接触的东西,按照惯例,在刚开始学习一个东西的时候,先从宏观上去了解它.本篇博客,先介绍SQL Server的基本内容, ...

随机推荐

  1. 6 springboot Docker 部署

    安装请参考其他的教程请参考http://www.runoob.com/docker/centos-docker-install.htm 拉取zookeeper镜像 docker pull zookee ...

  2. uwsgi/uWSGI/WSGI简介

    参考文章 uWSGI是一个Web服务器,它实现了WSGI协议.uwsgi.http等协议.Nginx中HttpUwsgiModule的作用是与uWSGI服务器进行交换.z WSGI是一种Web服务器网 ...

  3. Window ssh免密登录到远程Linux服务器

    SSH采用的是”非对称密钥系统”,即耳熟能详的公钥私钥加密系统. 1. 基于口令的安全验证 这种方式使用用户名密码进行联机登录,一般情况下我们使用的都是这种方式.整个过程大致如下: (1)客户端发起连 ...

  4. git 之奇技淫巧

    1,git remote prune origin  本地有很多其实早就被删除的远程分支,可以用 git remote prune origin 全部清除掉,这样再 checkout 别的分支时就清晰 ...

  5. ES6框架的搭建

    1.引入traceur.js  http://google.github.io/traceur-compiler/bin/traceur.js 2.将Traceur编译器用于网页 new traceu ...

  6. 改bug后 fix bug 时,一个不错的修复描述模板

    *问题原因:* 问题出现的原因.*解决方法:* 问题的解决方案.*影响分支:* 影响哪些分支. *相关修改:* 具体的修改文件列表.*自测结果:* 自行测试了哪些用例,将大概步骤描述出来. *影响功能 ...

  7. MUI框架-12-使用原生底部选项卡(凸出图标案例)

    MUI框架-12-使用原生底部选项卡(凸出图标案例) 今天,用 mui 做 app 时,遇到了可能各位都遇到过的头疼问题:底部中间图标凸起,如下图: 最后有源代码 [提示]:有人问我在 HBuilde ...

  8. BubblePopupWindow

    Android 实现各个方向的气泡弹窗,可控制气泡尖角偏移量. https://github.com/smuyyh/BubblePopupWindow 截图 使用: BubblePopupWindow ...

  9. 同步(Synchronous)和异步(Asynchronous)的概念

    web项目中的同步与异步 在我们平时的web项目开发中会经常听到ajax请求这样一个称呼,在web项目中可以通过js或者jquery发送同步请求又或者异步请求,同步请求呢往往代表着你必须等待这次请求结 ...

  10. IEC62304-2006解读

    IEC62304强调医疗软件在明确和满足其预期用途的前提下,不能引发不可接受的风险 62304提供一个医疗软件开发的框架,并指出框架下每个过程的要求,62304将过程分解为若干活动,活动分解为若干任务 ...