Can Nexus also handle non GraphQL requests? #1052
Answered
by
iherger
marceloverdijk
asked this question in
General
-
If I understand Nexus is based on Express, so I wonder if it's possible to access the server object and add other custom routes? I also read that Nexus basically wants to abstract the engine it's using. |
Beta Was this translation helpful? Give feedback.
Answered by
iherger
Jun 18, 2020
Replies: 2 comments
-
Yes, you can do e.g. import { Request, Response } from "express";
server.express.get("/auth/login/:email/:token", (req: Request, res: Response) =>
loginResponse(req, res),
);
server.express.disable("x-powered-by"); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
marceloverdijk
-
Yes, Couldn't find https://www.nexusjs.org/#/api/modules/main/exports/server before but indeed it explains how to get the express instance. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you can do e.g.