# How to set up nextjs api route?

**URL:** <https://community.apollographql.com/t/how-to-set-up-nextjs-api-route/808>\
**Category:** Server\
**Tags:** server, web\
**Created:** [July 19, 2021, 3:07pm UTC](https://community.apollographql.com/t/how-to-set-up-nextjs-api-route/808 "2021-07-19T15:07:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralflopez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/ralflopez/32/553_2.png) [@ralflopez](https://community.apollographql.com/u/ralflopez)\
**Post date:** [July 19, 2021, 3:07pm UTC](https://community.apollographql.com/t/how-to-set-up-nextjs-api-route/808/1 "2021-07-19T15:07:58Z")

</div>

Im using apollo-server-micro. Im having problems with apollo studio reaching my api. I either get a cors error and when I set up cors I get a “called start() with surprising state started” error. Hope you can help me with the setup or provide an example code. Im using apollo-server-micro 3.0.1
