lenra-io / devtool

GNU Affero General Public License v3.0
5 stars 1 forks source link

[Bug]: Can't open app directly from other url than `/` #184

Closed jonas-martinez closed 1 year ago

jonas-martinez commented 1 year ago

What happened?

When opening the application (or refreshing the page) from another URL than /, the devtool phoenix server returns an error because it doesn't know the URL.

In fact, specifically for the devtool, the client is generated as HTML and put into the static folder of the phoenix server. This means that this server needs to define the routes that will be redirected to this static file. But as we can see in the current state of the router.ex file :

scope "/", DevTool do
    get("/", IndexController, :index)
end

Only the / route directs to the client which is handled by the IndexController. This means that any other route than / will not work when it is firstly opened or refreshed on.

We need to find a way to make this router redirect any route to the IndexController without interfering with other already defined routes.

What browsers are you seeing the problem on?

Other (specify above)

Version

v1.0.0-alpha.2

Relevant log output

No response

jonas-martinez commented 1 year ago

Closed by https://github.com/lenra-io/devtool/pull/187