summaryrefslogtreecommitdiff
path: root/packages/integrations/node/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/node/README.md')
-rw-r--r--packages/integrations/node/README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/integrations/node/README.md b/packages/integrations/node/README.md
index 165a0733d..2464892a9 100644
--- a/packages/integrations/node/README.md
+++ b/packages/integrations/node/README.md
@@ -122,6 +122,25 @@ app.use(ssrHandler);
app.listen({ port: 8080 });
```
+Additionally, you can also pass in an object to be accessed with `Astro.locals` or in Astro middleware:
+
+```js
+import express from 'express';
+import { handler as ssrHandler } from './dist/server/entry.mjs';
+
+const app = express();
+app.use(express.static('dist/client/'))
+app.use((req, res, next) => {
+ const locals = {
+ title: 'New title'
+ };
+
+ ssrHandler(req, res, next, locals);
+);
+
+app.listen(8080);
+```
+
Note that middleware mode does not do file serving. You'll need to configure your HTTP framework to do that for you. By default the client assets are written to `./dist/client/`.
### Standalone