Skip to content

front and back ends have conflicting urls #78

@ahdinosaur

Description

@ahdinosaur

example: using the dogstack-example, i browse to /, sign in, then navigate to /dogs. everything is great, until i refresh the page and see an array of dog objects from the dogs service.

why does this happen?

the server api (back end) is not prefixed, so the dogs service is served by feathers-rest at /dogs. this conflicts with the common route for a page that shows all the dogs: /dogs.

this was re-introduced in 912d5a5, when i added feathers-rest. we've avoided this in Cobuy, purely by chance.

how do we solve this?

we should make a sub-app for all the services, which is prefixed with /api. then use this as the base url for the feathers client. however, we must ensure we handle this bug: feathersjs/feathers#232, which is the reason i avoided using a sub-app when earlier versions of dogstack (on a previous contract) used a sub-app but had annoying edge cases from this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions