# How do I configure a route to be server side rendered?

**URL:** <https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353>\
**Category:** DoneJS\
**Created:** [July 11, 2016, 2:32pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353 "2016-07-11T14:32:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tracer99](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/tracer99/32/35_2.png) [@tracer99](https://forums.bitovi.com/u/tracer99)\
**Post date:** [July 11, 2016, 2:32pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/1 "2016-07-11T14:32:15Z")

</div>

There is documentation on how to render a simple example using Done-SSR, but I don’t understand how that translates to a DoneJS application. I want to be able to specify that all the routes should be server side rendered except for one (and it’s children).

Can someone point me to an example?

---

<div class="post-metadata">

**Author:** ![marshallswain](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/marshallswain/32/22_2.png) [@marshallswain](https://forums.bitovi.com/u/marshallswain)\
**Post date:** [July 12, 2016, 1:57pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/2 "2016-07-12T13:57:54Z")

</div>

I believe you can wrap that route in an if statement

If(!window.doneSsr){  
route(…)  
}

---

<div class="post-metadata">

**Author:** ![marshallswain](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/marshallswain/32/22_2.png) [@marshallswain](https://forums.bitovi.com/u/marshallswain)\
**Post date:** [July 12, 2016, 1:59pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/3 "2016-07-12T13:59:35Z")

</div>

doneSsr might be the wrong attribute name, but if it doesn’t work you can console.log the keys on window to find it, refresh the page then check the terminal window

---

<div class="post-metadata">

**Author:** ![matthewp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/matthewp/32/77_2.png) [@matthewp](https://forums.bitovi.com/u/matthewp)\
**Post date:** [July 12, 2016, 4:36pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/4 "2016-07-12T16:36:58Z")

</div>

There is a window.doneSsr, that’s right, you can also check if you are running in Node:

```auto
var isNode = typeof process === "object" && {}.toString.call(process) === "[object process]";

```

---

<div class="post-metadata">

**Author:** ![tracer99](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/tracer99/32/35_2.png) [@tracer99](https://forums.bitovi.com/u/tracer99)\
**Post date:** [July 12, 2016, 4:38pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/5 "2016-07-12T16:38:19Z")

</div>

I’m confused though, at this point isn’t the application already loaded into the client? How do I prevent the app from client side loading?

---

<div class="post-metadata">

**Author:** ![matthewp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/matthewp/32/77_2.png) [@matthewp](https://forums.bitovi.com/u/matthewp)\
**Post date:** [July 12, 2016, 6:15pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/6 "2016-07-12T18:15:28Z")

</div>

The same code runs on the client and server, so if you write some code like:

```auto
If(!window.doneSsr){
route(...)
}

```

In Node this route will not be defined and therefore won’t be available to go to. In the client it will be available (if say you are going from page a to b).

---

<div class="post-metadata">

**Author:** ![tracer99](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/tracer99/32/35_2.png) [@tracer99](https://forums.bitovi.com/u/tracer99)\
**Post date:** [July 12, 2016, 9:00pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/7 "2016-07-12T21:00:43Z")

</div>

My question is in the reverse. This would be how to exclude a section from SSR. But I want to know how to have pages Server Side rendered.

---

<div class="post-metadata">

**Author:** ![marshallswain](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/marshallswain/32/22_2.png) [@marshallswain](https://forums.bitovi.com/u/marshallswain)\
**Post date:** [July 26, 2016, 3:04pm UTC](https://forums.bitovi.com/t/how-do-i-configure-a-route-to-be-server-side-rendered/353/8 "2016-07-26T15:04:08Z")

</div>

Generate an app with DoneJS and run `donejs develop` and all pages are automatically SSR’d.
