-
Notifications
You must be signed in to change notification settings - Fork 65
Integrated server support for CORS #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
With the new custom server api #382 you should be able to do something like this now: import cors from 'cors'
server.custom(({ express }) => {
express.use(cors())
}) |
What would an ideal cors API in core look like? Is there something the framework can do worthwhile here? Should this be relegated to server custom logic? |
In the context of the Scaffold project using |
@nargetdev For now its just an express instance, so nothing novel from the Framework https://www.nexusjs.org/#/api/modules/main/exports/server?id=express. |
When I try to follow the code sample referenced in the link above, I get the following error:
My code looks like this:
|
@crtr0 Setting |
I added the following line to my
When I run
I'm sorry if I'm missing something, but I'm new to TypeScript and it seems to be what Nexus is built with. Is there an option to use Nexus without TypeScript? |
No problem. For what its worth we have a little curated list of material to help learn it: https://www.nexusjs.org/#/getting-started/onboarding?id=pre-requisites
Not yet but keep an eye on/weigh in at graphql-nexus/nexus#85.
should solve it 🤞 |
That worked! Thank you! 👍 |
Hey there! 👋 running
(I'm using a really simple, private, monorepo, but everything is working, I was using update: It seems that it's caused by #727 |
I'm having the same |
I do have similar problem. But when i run build and then I run node .nexus/build/api on production (or localhost) it's not accepting my requests. Like CORS are not enabled. Any ideas why? |
Perceived Problem
I am not able to use the
nexus-future
GraphQL server from my frontend. I am getting the errorIdeas / Proposed Solution(s)
The text was updated successfully, but these errors were encountered: