# Server-side rendering Marko allows any Marko template/UI component to be rendered on the server or in the browser. A page can be rendered to a `Writable` stream such as an HTTP response stream as shown below: ```js var template = require("./template"); // Import ./template.marko module.exports = function(req, res) { res.setHeader("Content-Type", "text/html; charset=utf-8"); template.render({ name: "Frank" }, res); }; ``` Marko can also provide you with a `Readable` stream. ```js var template = require("./template"); // Import ./template.marko module.exports = function(req) { // Return a Readable stream for someone to do something with: return template.stream({ name: "Frank" }); }; ``` > **ProTip:** Marko also provides server-side framework integrations: > > - [express](./express.md) > - [hapi](./hapi.md) > - [koa](./koa.md) > - [huncwot](./huncwot.md) ## UI Bootstrapping When a page is rendered on the server, additional code is added to the output HTML to allow the UI to instantly boot in the browser. This additional code allows UI components rendered on the server to be mounted in the browser automatically. For each _top-level_ UI component, Marko will serialize the component's data (including `input` and `state` and any properties added to the UI component instance) so that each top-level UI component can be re-rendered and mounted when the page loads in the browser. Only a "partial" re-render is done for each top-level UI component. That is, when doing the partial re-render in the browser, the DOM is not updated and no virtual DOM is actually produced. Marko encodes required information into attributes of rendered HTML elements and it also generates `