Comments (11)
@andreftavares Thank you very much for your response. I was able to run it after installing bcrypt manually. I also had to install sass manually
npm install [email protected]
npm install [email protected]
now i am trying to run atlas locally but getting some cross origin related issue.
Again thanks for this wonderful project and sharing your knowledge.
from atlas.
Hi,
First of all thanks for your support! Looking forward to hear your thoughts after you get it working :)
I see from the log you posted above that you're running node v6.4.0 and npm v3.10.3. Can you try with node v4.x LTS? (I have it running in node.js v4.2.5 and npm v.3.5.3)
You can use something like https://github.com/creationix/nvm to switch between node.js versions.
Hope it helps! Looking forward to your feedback.
from atlas.
@nash90 any luck? :)
from atlas.
@nash90 thanks for your answer! Will test those versions and perhaps update the requirements.
In regards to the "cross origin" issue, can you provide more details?
from atlas.
@andreftavares
The actual issue occurred when I was using atlas and nicistore simultaneously locally. nicistore failed to call apis in atlas.
The javascript console log for nicistore app is attached.
The error message is
"XMLHttpRequest cannot load http://localhost:8000/api/v1/account. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404."
In my understanding as nicistore is hosted in localhost:3000 domain and api is in localhost:8000 domain, when nicistore calls the atlas api there is "No access-control-allow-origin header is present in the resource" issue.
I was wondering how you solve above issue.
Regards,
from atlas.
@nash90 did you try running your local Storefront (nicistore) first against the Live Nicistore API and then switching to your local install of Atlas?
Because, from what I can tell, your local install of the Storefront is looking for the API base URL in http://localhost:8000/api/v1. If you're running the default development settings of Atlas, it is exposing the API in base URL http://localhost:8000/v1 (notice the lack of "/api" prefix) <-- Change the settings in the Storefront for this value instead (link)
In the production site nicistore.com, since I'm running both apps (storefront and backend) under the same domain, I opted by mounting the API in the prefix "/api" of the domain, thus the base URL being "https://nicistore.com/api/v1" (link)
Hope this helps!
from atlas.
I've updated nicistore's readme to better explain this scenario (link) please tell me if you think it more clear :)
from atlas.
@andreftavares After I changed the API base URL to http://localhost:8000/v1, it worked. Thank you so much.
However, I didnt understand the reason of access-control-allow-origin error for earlier case.
I noticed that the response has following header this time when it worked which I think was not present in earlier case.
access-control-allow-origin:http://localhost:3000
Does that mean the api is specially set to add above header in response for all requests. It would really help me to study this behaviour if could give me link to that portion of code.
from atlas.
@andreftavares By the way, thanks for updating readme. Its very clear now.
from atlas.
@nash90 if you look closely, the issue is that the URL (http://localhost:8000/api/v1) simply does not exist and the API is returning a 404 Not Found :) I'm guessing that Hapi.js simply does not return CORS headers in the case of unexisting routes, thus the CORS message.
Indeed it can lead to misunderstandings... I got used to it, never did much research on the matter!
In Atlas, I configure Hapijs's CORS here https://github.com/yoonic/atlas/blob/master/src/server.js#L32-L35 and you can dig a little further in Hapij's documentation here http://hapijs.com/api
from atlas.
@andreftavares Thanks for the info.
from atlas.
Related Issues (20)
- How to setup JWT_KEY ? HOT 17
- npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. HOT 9
- Why not unit tests? HOT 2
- Design Style which you are following? HOT 3
- Can't run on Docker HOT 16
- Can't upload images HOT 4
- Integrating Paytm Payment Gateway HOT 2
- Paypal support? HOT 11
- Is this repository going to be maintained? HOT 2
- Atlas is not running on docker digital ocean HOT 2
- Atlas is not getting deployed on VPS using Dockerfile HOT 1
- Paypal HOT 1
- getting error on npm install HOT 2
- ecommerce to marketplace
- Do you have implementation for mongoose? HOT 1
- Error after npm run dev - Cannot read property 'error' of undefined HOT 6
- Atlas with mongoDB HOT 1
- would you consider about horizonjs? HOT 3
- Ever tested new bcrypt/node-sass modules? HOT 2
- Can't run app HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlas.