lite-server
by Todd Palmer
托德·帕尔默(Todd Palmer)
如何使用lite-server进行简单开发的Web服务器 (How you can use lite-server for a simple development Web Server)
If you need an easy and light-weight Web Server just to do some development, lite-server is an excellent choice.
如果仅需要简单易用的Web Server来进行开发,则lite-server是一个绝佳的选择。
In this article I will:
在本文中,我将:
Briefly explain the what and why of lite-server.
简要说明lite-server的内容和原因 。
Show you how to create a simple web application and serve it with lite-server.
向您展示如何创建一个简单的Web应用程序并将其与lite-server一起使用 。
Explain some simple lite-server configuration.
解释一些简单的lite-server配置 。
Finally, if you just want to install lite-server once and use it everywhere, take a look at my project www-lite-server in GitHub.
最后,如果您只想安装一次lite-server并在各处使用它 ,请查看我在GitHub中的项目www-lite-server 。
Although this is written as an introductory level article, I expect that:
尽管本文是介绍性文章,但我希望:
- You know a little about the command prompt, such as creating and switching directories. 您对命令提示符有些了解,例如创建和切换目录。
You have npm installed and understand how to use it to install packages.
您已经安装了npm并了解如何使用它来安装软件包。
- You know how to create simple web pages using HTML. 您知道如何使用HTML创建简单的网页。
什么是精简服务器? (What is lite-server?)
lite-server is a lightweight development web server with support for Single Page Apps (SPAs). Actually, it is bit more technical than that. But, for our purposes, that’s good enough.
lite-server是一种轻量级开发Web服务器,支持单页应用程序(SPA) 。 实际上,它比这更具技术性。 但是,就我们的目的而言,这已经足够了。
lite-server was created by John Papa. You should follow him and read all his stuff, because he is a true hero of the open source community!
lite-server由John Papa创建。 您应该关注他并阅读他的所有文章,因为他是开源社区的真正英雄 !
John created lite-server because he wanted a simple web server he could use to test deploying Single Page Applications that leverage URL routes. Maybe you aren’t using JavaScript G