How to build with GraphQL Server? #556
Answered
by
ije
skorotkiewicz
asked this question in
General
-
If I build my project, it's output only the Client side without server, how can I build with GraphQL server? ServeQL(yoga, {
port: 4000,
});
serve({
plugins: [denoDeploy({ modules }), react({ ssr: true }), unocss(config)],
// middlewares: [
// ],
}); |
Beta Was this translation helpful? Give feedback.
Answered by
ije
May 12, 2023
Replies: 1 comment 3 replies
-
use the middleware: serve({
plugins: [denoDeploy({ modules }), react({ ssr: true }), unocss(config)],
middlewares: [
(req, ctx) => {
const url = new URL(req.url)
if (url.pathbame === "/api/ql") return yoga(req)
ctx.next()
}
],
}); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
skorotkiewicz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use the middleware: