How to build with GraphQL Server?
skorotkiewicz opened this issue · comments
If I build my project, it's output only the Client side without server, how can I build with GraphQL server?
On deno task dev
, it's run GraphQL and Aleph Server and it works perfect.
ServeQL(yoga, {
port: 4000,
});
serve({
plugins: [denoDeploy({ modules }), react({ ssr: true }), unocss(config)],
// middlewares: [
// ],
});
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()
}
],
});