Greetings,
I’m struggling to observe the advertised behavior of jets call
. I have a simple brand new jets application created with: jets new my-service --mode api --database=postgres
I have scaffolded a single samples controller with a single Sample model with a single column kit_id. I have also changed the catchall route to route to samples#index.
I have verified database connectivity using jets server
and hitting the endpoints using curl.
However when I use jets call
as follows I get unexpected behavior.
jets call samples_controller-show '{"id": 1}' --local
Local mode enabled!
Function name: s2-dev-samples_controller-show
I, [2020-08-13T07:20:34.039692 #32378] INFO -- : Started "" for at 2020-08-13 07:20:34 +0000
I, [2020-08-13T07:20:34.040031 #32378] INFO -- : Processing SamplesController#index
I, [2020-08-13T07:20:34.040405 #32378] INFO -- : Event: {"queryStringParameters":{"id":1},"body":null,"pathParameters":null}
I, [2020-08-13T07:20:34.040753 #32378] INFO -- : Parameters: {"id":1}
I, [2020-08-13T07:20:34.174340 #32378] INFO -- : Completed Status Code 200 in 0.134671207s
I would expect jets to invoke SamplesController#show
, not SamplesController#index
.
I have spent the better part of the day investigating this and narrowed it down to the middleware stack. It appears that an environment variable lambda.meth is correctly set to ‘:show’, but the router does not seem to respect that.
Since nobody else seems to be experiencing this issue I assume it is user error, but I am at my wits end as to what I’m doing incorrectly.
Any help is greatly appreciated.
-Josh