Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 563 Bytes

serve-static-web-content.md

File metadata and controls

27 lines (17 loc) · 563 Bytes

Serve Static Web Content

Category: Nodejs

Nodejs provides the ability to serve static web content using the serve package.

Install serve globally:

yarn global add serve

Assuming your web site content resides in a directory called build, serve on the default port of 3000 as follows:

serve -s build

Access the web site at http://localhost:3000

If necessary, you can specify a different port using the -l flag. To serve on port 4000:

serve -s build -l 4000

Access the web site at http://localhost:4000