Receiving POST request from external web site? (vue-apollo and internal APIs) #488
Unanswered
KnowblyTrip
asked this question in
Q&A
Replies: 1 comment
-
I guess you need this? https://vue-cli-plugin-apollo.netlify.com/guide/express-middleware.html |
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
-
Hoping for some insight, and apologies if this is not the appropriate forum for this question. I'm building a plug-in for a third-party platform using Vue CLI 3 and vue-apollo. As part of the launch of my plug-in in that host platform (they use LTI), the lti_launch sends a POST to a URL of my choosing. Obviously, I can't capture that at a route in vue-router. Within the confines of vue-apollo, how do I establish an endpoint to receive that POST data so that I can resolve the URL, capture the data, and then redirect to the main page of the app? I'm currently running my app locally -- http://localhost:4000/graphql for server and https://localhost:8080/ for client. The host application requires the endpoint be served over https, so my first question would be how to get the graphql server to run over https.
My view.config.js:
My vue-apollo.js:
My .graphqlconfig.yml:
I'm somewhat new to Vue. Aside from the actual front end stuff, which I wrote, most of the app just uses the default scaffolding through Vue CLI 3 and vue-apollo plugin. I'm sure there's something simple I'm missing, but scanning through the various docs online and googling hasn't gotten me very far.
I have tried changing all references to localhost:4000 to https (they are http in the snippets above) -- but that doesn't seem to change the running app.
Assuming I can get localhost:4000/graphql to run over https:// -- if that is what I am, indeed, meant to do -- where/how do I establish my own internal API endpoints. I only really need the one to receive that POST request from the third-party host application. Other than that, the app just consumes other third-party APIs via GET and displays the content in a dashboard on the client.
Is there a standard or Best Practice way to achieve what I'm looking to do? Do I need to write some Express middleware? Is there a doc that explains it all that I simply can't find. Does vue-apollo handle this sort of thing natively, or do I need to write my own middleware, etc? Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions