How can I create API routes such as `<http://auth....
# help
a
How can I create API routes such as
<http://auth.abc.xyz/.well-known/openid-configuration|auth.abc.xyz/.well-known/openid-configuration>
and
<http://auth.abc.xyz/.well-known/jwks.json|auth.abc.xyz/.well-known/jwks.json>
using the
sst.Api
construct. Is this doable, I’m trying to create an openid discovery endpoint for a custom auth service so there’s no way I can use another route.
so, the
<http://auth.abc.xyz/.well-known/openid-configuration|auth.abc.xyz/.well-known/openid-configuration>
endpoint was successfully deployed but I am not able to do so with the
jwks.json
route.
the
jwks.json
route returns me a http 500 and doesn’t even hit my lambda, I think the api gw is blocking it for some reason.
f
I just gave this a try. Added a
/.well-known/jwks.json
route, and started up
sst start
. Lambda does receive the request, and it was sent to my local, but I got a weird error.
a
yes, this happens to me as well, exactly the same.
I know this is an aws and my application related requirement but could you please assist me in getting this up and running, it is an urgent requirement and this issue blocks me completely.
f
Does the Lambda also error out after u
sst deploy
?
a
haven’t tried it, I’ll attempt it.
f
Yeah, give that a try. And let’s see if it’s an issue with
sst start
specificlly.
a
okay, this works with
sst deploy
. I’ll disable the live mode for this for now, frankly live mode is a luxury, though if you can spare the bandwidth to get this working with
sst start
then I’d be very glad, would help me get my work done faster. Thank you for the guidance, I really appreciate it. 😁🙏
f
Oh nice! Just to double check, u saw the same
require is not defined
error?
a
yes, this is the thread describing it.
p
Did you find any resolution on this? I'm experiencing the same issue, but in relation to
sns.publish()
. The thread you link to doesn't have any responses so asking here.
a
@Peter Slattery I am bypassing this by not using the erroring live mode. Everything works fine for me with
sst deploy
.
f
@thdxr I’m seeing smth really weird here, I tried reproduce @Ashishkumar Pandey’s issue:
Copy code
new Api(stack, "api", {
  routes: {
    "GET /.well-known/openid-configuration": "lambda.main",
    "GET /.well-known/jwks.json": "lambda.main",
  }
});
1st route works,
jwks.json
route fails. U can see my Console screenshot above.
Both routes point to the same function, so can’t be the code.
t
tracked down this issue, the function loader has an issue where there's
.
in the path name, pushing a fix now
fixed in 1.0.2
a
@thdxr could you cherry pick the fix and release it in the 0.69.x version as well? Can't risk breaking anything by an hasty upgrade. 😅