Troubleshooting 404 Error for POST Route in Swagger API

Ok i'm at a complete loss. Ive looked at this for hours. I'll try to keep this short

I have a route defined /{envid}/as/authorize

my swagger shows this in my docs. This route is built with routerbuilder, and everything shows up just fine, I have no type errors.

When I use swagger or curl to post to it, i get a 404 not found error.

I have 1 other route, a healthcheck route, that looks basically identical but its a get, and it works just fine.

more or less without posting a lot of code

const apiSpec = pipe(
  Api.make({ title: 'MockApi' }),
  Api.addEndpoint(
    pipe(
      Api.post('DavinciAuthorize', '/:envid/as/authorize?params').pipe(
        Api.setRequestPath(Schema.Struct({ envid: Schema.String })),
        Api.setRequestQuery(Schema.Struct({ params: DavinciAuthorizeHeaders })),
        Api.setResponseBody(DavinciAuthorizeSuccess),
      ),
    ),
  ),
  Api.addEndpoint(
    pipe(Api.get('HealthCheck', '/healthcheck').pipe(Api.setResponseBody(Schema.String))),
  ),
);


const app = RouterBuilder.make(apiSpec).pipe(
  RouterBuilder.handle(authorizeHandler),
  RouterBuilder.handle('HealthCheck', () => Effect.succeed('Healthy!')),
  RouterBuilder.build,
  Middlewares.errorLog,
);

app.pipe(
  cors({
    allowedMethods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
    credentials: true,
    allowedOrigins: ['http://0.0.0.0:8443', 'http://localhost:8443', 'https://localhost:8443'],
  }),
  NodeServer.listen({ port: 8443 }),
  NodeRuntime.runMain,
);


And my authorize handler is defined and again, no type errors. I just can't pinpoint why it says 404. to me it should at least hit the route, its defined, swagger seems to pick it up, and its just there!!!!!
Was this page helpful?