Issue with Root Path

Maybe is a dumb question but I’m starting to play with Jets. I had a little experience with rails but right know I’m studying Lambda and Serverless.
So I created a new Jets project, and I’m trying to do a simple hello world with the application Controller.

class ApplicationController < Jets::Controller::Base

def hello
puts “Hola mundo”
@Content = “Hello World”

To make it work with the Application layout, I made a hello.html.erb file in views/application

<%= @Content %>

And the routes file is:

Jets.application.routes.draw do
  root "application#hello"

  # The jets/public#show controller can serve static utf8 content out of the public folder.
  # Note, as part of the deploy process Jets uploads files in the public folder to s3
  # and serves them out of s3 directly. S3 is well suited to serve static assets.
  # More info here:
  any "*catchall", to: "jets/public#show"

With Jets Server, It appears to be working OK.

I can see the Hello World using the application.html.erb layout an the content from the controller.

But when I deploy to AWS:

  1. In API Gateway the only generated Resources are:

And the Invoke URL only shows:

{"message":"Missing Authentication Token"}

I could surpass this making a GET Resource in the root Resource


But now. I Only see the index page used for the catchall.

I’m trying to understand what is the APy Gateway doing or what is wrong with my routes, but if I test the GET Resource on the web, It returns the correct body.

So, why I’m seeing different results between the Resource Test, and the jets servier ( where I can see the hell world vs the Invoke URL?

ApplicationController doesn’t currently create lambda functions. Considered it an abstract controller.

But may change this in the future for this situation so it more closely matches local behavior. The catch is anyone who currently has public methods in their ApplicationController will have brand new functions, which isn’t the end of the world and can be fixed by making the methods private.

Try creating a different controller that inherits from ApplicationController.

Great, Thanks. That explains a lot.

Well, I will continue using a new controller.