Why does Phoenix create duplicate files and folders with "_web" suffix?

Why does Phoenix creates duplicate files and folders with “_web” suffix?

What exactly should be placed in those folders?

I am not even using Phoenix for web but for mobile API.

_web directory houses your controllers, views, etc.

Thanks for quick response.

Another question:

When I generate mix phx.new app --no-brunch --no-html, I am getting error:

no route found for GET / (app.Router)

Similar issue on github is resolved by closing another phoenix app running, but I don’t have anything else running.

Then you probably do not have a route defined for "/", you need to take a look at your router.ex to check if there’s one.

Usually at that point the greeting page is served, but as you generated the project without HTML it doesn’t make sense to generate code that is solely used to serve an HTML greeter.

So you need to try to connect to a route that actually exist or add the root-route if you need to add functionallity for it (which doesn’t make much sense, since I do not see any resource there in the API sense).

If your problem persists, please open a new thread with more details as the exact stacktrace you get, your routes.ex and the URL you tried to open and how you did it (curl, browser other)

1 Like

Thanks.

I had to create: “pipeline :browser” to be able to show it in browser ( :021: )

EDIT:

Actually I didn’t, it works with pipeline: :api