sailscastshq / boring-stack

Ship JavaScript products with battle-tested technologies in days not weeks.
https://docs.sailscasts.com/boring-stack/getting-started
MIT License
390 stars 19 forks source link

Do you think Blueprints in sails should be deactivated? #96

Closed lennyAiko closed 5 months ago

lennyAiko commented 5 months ago

Description

I noticed that in the boring-stack, the sails blueprint API is activated, and it works. Though it fetches the data of the page as HTML, not JSON.

I want to be sure if the blueprints API in any way aids inertia, or if it poses no flaw. I am also pointing it out because the page I am able to fetch with the blueprints API is an authenticated page.

Current behavior

When I run localhost:1337/api/articles, I get my response as JSON on Postman. (can be accessed, not authenticated route)

However, when I run localhost:1337/articles I get my response as HTML on Postman. (should not be access, authenticated route)

Expected behavior

If it is possible for localhost:1337/articles to not be accessible since it is a page, it might be authenticated.

Feel free to ask more questions. @DominusKelvin ...

Replace space in square bracket with x e.g [x]

[x] I have checked and this issue does not exist

DominusKelvin commented 5 months ago

Yeah I don't use blueprints most of the time so I basically just turn it off. It's not a flaw but don't have much value when you are building a full-stack app @lennyAiko

lennyAiko commented 5 months ago

Alright noted. Thanks @DominusKelvin

Could it be turned off from the template? Just in case it does not come to thought for other users of the boring-stack.

DominusKelvin commented 5 months ago

@lennyAiko I think so, you can submit a PR to that effect for all 3 templates

lennyAiko commented 5 months ago

Thanks @DominusKelvin I will submit that PR!

DominusKelvin commented 5 months ago

Hey @lennyAiko, I've merged the PR to fix this so perhaps we can close it now?

DominusKelvin commented 5 months ago

I'm going ahead to close this issue as @lennyAiko's #101 PR resolves it.