I’ve been seeing questions about how actionHero’s routes interact with the actions. Here’s a bit more of an explanation (which I’ll keep to date on the ActionHero documentation wiki):
This variables in play here are:
Say you have an action called ‘status’ (like in a freshly generated actionHero project). Lets start with actionHero’s default config:
api.config.servers.web.urlPathForActions = 'api'; api.config.servers.web.urlPathForFiles = 'public'; api.config.servers.web.rootEndpointType = 'file';
There are 3 ways a client can access actions via the web server.
The api.config.servers.web.rootEndpointType is "file" which means that the routes you are making are active only under the /api path. If you wanted the route example to become server.com/stuff/statusPage, you would need to change api.config.servers.web.rootEndpointType to be ‘api’. Note that making this change doesn’t stop server.com/api/stuff/statusPage from working as well, as you still have api.config.servers.web.urlPathForActions set to be ‘api’, so both will continue to work.
If you want to shut off access to your action at server.com/api/stuff/statusPage and only allow access via server.com/stuff/statusPage, you can disable api.config.servers.web.urlPathForActions by setting it equal to null (but keeping the api.config.servers.web.rootEndpointType equal to ‘api’).