Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

browser url incorrectly points to content-api #88

Closed
alidcast opened this issue Sep 27, 2017 · 4 comments
Closed

browser url incorrectly points to content-api #88

alidcast opened this issue Sep 27, 2017 · 4 comments
Assignees

Comments

@alidcast
Copy link
Contributor

alidcast commented Sep 27, 2017

related to comment in #83

This question is available on Nuxt.js community (#c75)
@alidcast
Copy link
Contributor Author

alidcast commented Sep 27, 2017

The problem is that binaries were removed, so you have to set STATIC=true in command so that url can be set appropritely.

Then it works:

nuxt:axios BaseURL: http://localhost:3000/content-api (Browser: /_nuxt/content)

Right now there's a problem without using binaries (see #89). I'll wait until that is resolved before figuring out how to let users specify that they are using a static site.

Note: Ideally, if baseURL is empty we should just make static the default, since most apps will need to specify baseURL for content-api.

@josh--
Copy link

josh-- commented Sep 28, 2017

just dropping this by because i think its related to this and issue #83.

previously i opened a ticket that was throwing the same type of errors.

#47

you had added a new param that when used in the main configuration. would allow the generated site to work correctly. The reason was because the environmental variable is not available, in the browsers context when hosting as a plain static site.

@alidcast
Copy link
Contributor Author

Yes isStatic in config and process.env.STATIC will both have to be fixed, thanks for bringing this up

@josh--
Copy link

josh-- commented Sep 28, 2017

no prob, i was just taking a quick peek. Something like this should do it (https://www.npmjs.com/package/envify). idk if thats the best fit or not but something along those lines might help.

medfreeman added a commit that referenced this issue Sep 29, 2017
medfreeman added a commit that referenced this issue Sep 29, 2017
Properly set `axios` baseUrl accordingly
Properly trigger static routes generation in content builder accordingly

fixes #83, #88, #89
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants