<h1 dir="auto">Feature request</h1>
<h2 dir="auto">Is your feature request related to a problem?</h2>
<p dir="auto">Currently it's not possible to make async operations before exporting the handler from a API route.</p>
<h2 dir="auto">Describe the solution you'd like</h2>
<p dir="auto">I'd like to be able to use the same mecanism from <a href="https://zeit.co/blog/micro-9-1" rel="nofollow">micro</a> to be able to do async work before returning a handler.</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">I opened a discussion about it on spectrum : <a href="https://spectrum.chat/next-js/general/async-api-route~b1d7dddd-50fc-4f6f-a565-63fa68a725be" rel="nofollow">https://spectrum.chat/next-js/general/async-api-route~b1d7dddd-50fc-4f6f-a565-63fa68a725be</a></p>
<p dir="auto">Hi,<br>
Currently, we can pass the through the <code class="notranslate">renderPage</code> through the <code class="notranslate">_document.js</code> for decorating our components. This seems a bit restrictive, since I want to decorate one of my pages on the server side.</p>
<p dir="auto">I've looked into it, there seems no straightforward way of accomplishing this. Correct me if I'm wrong. If there isn't, then I'll start making a pull request.</p>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>