R
Railwayβ€’11mo ago
jared.leddy

Gravity Forms POST Does Not Work

We've got a client with a WordPress website. We are using Gravity Forms to capture uploaded files. Our last ditch effort was to create a middleware app that will accept the Gravity Forms POST, or Webhook, digest the data and do the following in Google Drive: 1. Create a new folder. 2. Upload the files from URL into the newly created folder. We've tested this many times, but the only one that fails is the direct test. Passed Tests: 1. Run the app locally, and use Postman to POST the JSON data. 2. Deploy the app to Railway, and use Postman to POST the JSON data. Failed Tests: 1. Deploy the app to Railway, and use Gravity Forms to submit the data. The POST of JSON data was done through the Gravity Forms Webhooks plugin. 2. Deploy the app to Railway, and use Gravity Forms to submit the data. The POST of JSON data was done through the Gravity Forms Send to 3rd Party plugin. Both of these plugins have confirmed they are working, using PipeDream to accept the POST data. The two failed test above were updated to send the data to PipeDream and the data was received successfully. Which means that the problem is explicitly with sending the data from Gravity Forms to our deployed Railway app. Is there anything in Railway that would block this from working?
9 Replies
Percy
Percyβ€’11mo ago
Project ID: N/A
jared.leddy
jared.leddyβ€’11mo ago
Before anyone dives down the rabbit hole of CORS, the domains have already been whitelisted. This is a Nest.js app, which is basically an Express.js app in TypeScript.
// setup cors on subdomain
app.enableCors({
origin: [
// website
'https://pixeldesigns.net',
'https://staging.pixeldesigns.net'
],
credentials: true
});
// setup cors on subdomain
app.enableCors({
origin: [
// website
'https://pixeldesigns.net',
'https://staging.pixeldesigns.net'
],
credentials: true
});
Brody
Brodyβ€’11mo ago
you say its failing, but i dont think you have said how its failing?
jared.leddy
jared.leddyβ€’11mo ago
I'm still trying to check the WordPress logs, but I don't have direct access to the server. Here are the logs from testing the app is working using Postman.
> nest start
NODE_ENV = prod
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [NestFactory] Starting Nest application...
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] AppModule dependencies initialized +32ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] GravityFormsModule dependencies initialized +0ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] ConfigModule dependencies initialized +1ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [RoutesResolver] GravityFormsController {/v1/gravity-forms}: +125ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [RouterExplorer] Mapped {/v1/gravity-forms/upload, POST} route +3ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [NestApplication] Nest application successfully started +2ms
Folder created
new folder id: 1mWYVdF64Mp9_Ob4cq46ZbjjGNcyXUiVx
> nest start
NODE_ENV = prod
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [NestFactory] Starting Nest application...
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] AppModule dependencies initialized +32ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] GravityFormsModule dependencies initialized +0ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [InstanceLoader] ConfigModule dependencies initialized +1ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [RoutesResolver] GravityFormsController {/v1/gravity-forms}: +125ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [RouterExplorer] Mapped {/v1/gravity-forms/upload, POST} route +3ms
[Nest] 37 - 12/30/2023, 4:03:45 AM LOG [NestApplication] Nest application successfully started +2ms
Folder created
new folder id: 1mWYVdF64Mp9_Ob4cq46ZbjjGNcyXUiVx
In the failed test, the "Folder Created" and "New Folder ID" log statements are not being added, nor are any errors present. Which could only mean that the POST did not hit the server.
> nest start
NODE_ENV = prod
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [NestFactory] Starting Nest application...
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] AppModule dependencies initialized +32ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] GravityFormsModule dependencies initialized +1ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [RoutesResolver] GravityFormsController {/v1/gravity-forms}: +120ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [RouterExplorer] Mapped {/v1/gravity-forms/upload, POST} route +3ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [NestApplication] Nest application successfully started +2ms
> nest start
NODE_ENV = prod
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [NestFactory] Starting Nest application...
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] AppModule dependencies initialized +32ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] GravityFormsModule dependencies initialized +1ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [RoutesResolver] GravityFormsController {/v1/gravity-forms}: +120ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [RouterExplorer] Mapped {/v1/gravity-forms/upload, POST} route +3ms
[Nest] 37 - 12/30/2023, 4:09:55 AM LOG [NestApplication] Nest application successfully started +2ms
So here I am, trying to figure out why the POST didn't hit the server.
Brody
Brodyβ€’11mo ago
are you absolutely sure everything your doing is using https? ive seen a lot of users run into issues where their posts wont reach their server because they are done with http and thus get redirected to a get request
jared.leddy
jared.leddyβ€’11mo ago
I'm good now. There is a toggle to activate the POST in Gravity Forms. The client turned it off. πŸ€¦β€β™‚οΈ
Brody
Brodyβ€’11mo ago
awsome
jared.leddy
jared.leddyβ€’11mo ago
LoL! Someone about to get their access revoked.
Brody
Brodyβ€’11mo ago
thats fair though
Is there anything in Railway that would block this from working?
just dont jump on the blame train in the future πŸ˜‰
Want results from more Discord servers?
Add your server