简体   繁体   中英

Saleor front-end installation

I am trying to install saleor front-end package from github.The documentation is outdated and i get an error when i try

>>>nmp start
Error: Environment variable API_URI not set

I found this variable in different places but did not know what to change, and where to set it

EDIT:Solved.just in case somebody is going through the same problem in webpack>config.base.js

process.env.API_URI = 'http://localhost:8000/graphql/'

On Linux, I fixed this by setting environment variable before running npm; start with:

export API_URI=http://localhost:8000/graphql/

on the terminal.

create a file in the root directory of /saleor-storefront called ".env" and write inside:

API_URI=http://localhost:8000/graphql/

This will create an environment variable called API_URI with the value 'http://localhost:8000/graphql/'

Create .env file in a root directory or set environment variables with following values:

API_URI (required) - URI of a running instance of Saleor GraphQL API. If you are running Saleor locally with the default settings, set API_URI to: http://localhost:8000/graphql/ .

APP_MOUNT_URI - URI at which the Dashboard app will be mounted. Eg If you set APP_MOUNT_URI to /dashboard/ , your app will be mounted at http://localhost:9000/dashboard/ .

STATIC_URL - URL where the static files are located. Eg if you use S3 bucket, you should set it to the bucket's URL. By default Saleor assumes you serve static files from the root of your site at http://localhost:9000/ .

Saleor on Github: How to configure the Dashboard

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM