Hey. I'm looking to set up an application with nex...
# orm-help
g
Hey. I'm looking to set up an application with next.js, prisma, graphql-yoga and possibly some custom routes. Would it make sense to bake this into one express server, or should graphql-yoga rather be on it's own?
j
It should be trivial to package it all together in one Express app!
Copy code
const server = new GraphQLServer({
 ...
})

server.get("/helloWorld", (req,res) => {
  res.send("Hello, World!")
})

server.start(() => console.log(`Server is running on <http://localhost:4000`>))
There may be pitfalls that I am failing to consider, but that setup works perfectly well for my basic use-case!
p
I have same setup. I run prisma and next seperate. As its recommended by Zeit
@Gudmund
g
Great, thanks.
@pettanko Hm, I'm not perfectly clear, currently I mount '/' and '/_graphql' onto GraphQLServer object, is this not recommended by Zeit?
p
It's recommended to keep Front end and API seperate as far as I have read. So I let graphqlserver run like it is from boilerplate
g
@pettanko Ok, gotcha. Makes some sense, thanks