Skip to content

Commit

Permalink
docs: Add serve() info to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Aug 27, 2023
1 parent 1f108a6 commit e8be161
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,24 @@ Anansi can quickly traverse spouts setup by a user.
The server lays the spouts for anansi to travel in. Once delivered to the client, the spouts can be flooded (hydration).

In both cases, we need the route and application data.


## Scripts

### serve(entry, options?)

```ts
import { serve } from '@anansi/core/scripts';

serve('./dist-server/App.js');
```

#### serveAssets: boolean

Serves static assets. This is typically useful when validating server builds locally; but you
typically want to use a dedicated HTTP server for static assets in production.

#### serveProxy: boolean

Proxy requested based on webpack config devConfig. Useful for validating server builds locally.
In production it is much more performant to use a separate reverse proxy.

0 comments on commit e8be161

Please sign in to comment.