nicklandgrebe / active-resource.js

ActiveResource.js - API resource relational mapping in JavaScript
https://active-resource.js.org
MIT License
133 stars 20 forks source link

Wrong endpoint name in production (?) #47

Closed CharlieIGG closed 5 years ago

CharlieIGG commented 5 years ago

WHEN I use this library in development, by declaring

const resourceLibrary = createResourceLibrary("http://localhost:3000/api/v2");

THEN I can call Car.all() THEN ActiveResource calls the correct URL: "http://localhost:3000/api/v2/cars"

BUT...

WHEN I use this library in production, by declaring

const resourceLibrary = createResourceLibrary("https://mysite.com/api/v2");

THEN I can call Car.all() THEN ActiveResource INSTEAD calls an incorrect URL: "https://mysite.com/api/v2/ts"

which naturally returns a 404 error.

I honestly don't know where this is coming from.

Any Ideas?

CharlieIGG commented 5 years ago

@nicklandgrebe have you seen something like this happen before?

nicklandgrebe commented 5 years ago

https://github.com/nicklandgrebe/active-resource.js#baseclassname

You have to set this property when using a minifier.

I should make the docs on this better since they are so standard now

CharlieIGG commented 5 years ago

This does it @nicklandgrebe, I stopped reading after "optional". Just adding Heroku to that sentence would be great for future reference. 👍