mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Update fastify.md
This commit is contained in:
parent
af4adcd1ee
commit
413154288d
@ -40,7 +40,16 @@ app.get("/", (request, reply) => {
|
||||
|
||||
await fastify.listen(3000);
|
||||
```
|
||||
### Global Outputs
|
||||
We can add global outputs from the server side using the reply object or fastify instance.
|
||||
```javascript
|
||||
reply.locals.newProperty = 'Your value';
|
||||
```
|
||||
|
||||
To use this in marko components we just need to refer out.global
|
||||
```marko.js
|
||||
$ const { newProperty } = out.global;
|
||||
```
|
||||
### BYOB (Bring your own bundler)
|
||||
|
||||
For the large portion of Marko's API a bundler is required. The example code above assumes that Marko templates can be loaded in your environment.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user