Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn serve details #1

Open
wants to merge 1 commit into
base: src
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,30 @@ This creates a static web server with your built folder as the root.

This is useful to quickly preview your built Yarn site locally.

Note: Running `yarn serve` assumes that you have `http-server` installed. To install:

$ npm install -g http-server

Another example of temporary static file serving could be something like [Python's SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html):

$ cd _site
$ python -m SimpleHTTPServer 8080

When you're ready to more permanently serve your static site, you might want to consider something like NGINX. Here's a sample NGINX site config:

server {
listen 80;
server_name myyarnsite.com;

root /path/to/myyarnsite.com/_site;

location / {
}
}

More info: [https://www.nginx.com/resources/admin-guide/serving-static-content/](https://www.nginx.com/resources/admin-guide/serving-static-content/)

## `yarn watch`
This creates a local static web server and also watches for any changes in your source files to partially rebuild your Yarn site.

This is useful when developing your site or writing new content.
This is useful when developing your site or writing new content.