From 4b0254c37067949b6b818b99959ced9ce889079b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Bogda=C5=82?= Date: Sun, 22 Sep 2019 14:30:10 +0200 Subject: [PATCH] Configure Heroku integration --- README.md | 19 +++++++++++++------ app.json | 26 ++++++++++++++++++++++++++ package.json | 3 ++- static.json | 7 +++++++ 4 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 app.json create mode 100644 static.json diff --git a/README.md b/README.md index 71377376b..c6e13baa4 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,21 @@ A GraphQL-powered, single-page dashboard application for [Saleor](https://github.com/mirumee/saleor/). +## Demo + +See the [public demo](https://demo.getsaleor.com/dashboard/next/) of Saleor Dashboard! + +Or launch the demo on a free Heroku instance. + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) + ## Getting Started These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. ### Prerequisites -- Node.js 10.0+ +- Node.js 10.0+ - A running instance of [Saleor](https://github.com/mirumee/saleor/). ### Installing @@ -37,12 +45,11 @@ $ npm i There are two environment variables available for configuration: - - `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. - E.g. if you set `APP_MOUNT_URI` to `/dashboard/`, your app will be mounted at `http://localhost:9000/dashboard/`. +- `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. + E.g. if you set `APP_MOUNT_URI` to `/dashboard/`, your app will be mounted at `http://localhost:9000/dashboard/`. ### Development diff --git a/app.json b/app.json new file mode 100644 index 000000000..d0f12e514 --- /dev/null +++ b/app.json @@ -0,0 +1,26 @@ +{ + "name": "saleor-dashboard", + "description": "A GraphQL-powered, single-page dashboard application for Saleor", + "repository": "https://github.com/mirumee/saleor-dashboard", + "website": "http://getsaleor.com/", + "logo": "https://mirumee.com/img/opensource_saleor.jpg", + "keywords": ["saleor", "e-commerce", "dashboard"], + "env": { + "API_URI": { + "description": "URI of a running instance of Saleor GraphQL API", + "value": "https://demo.getsaleor.com/graphql/" + }, + "APP_MOUNT_URI": { + "description": "URI at which the Dashboard app will be mounted", + "value": "/" + } + }, + "buildpacks": [ + { + "url": "https://github.com/heroku/heroku-buildpack-nodejs.git" + }, + { + "url": "https://github.com/heroku/heroku-buildpack-static.git" + } + ] +} diff --git a/package.json b/package.json index d10af41d7..a02ae882e 100644 --- a/package.json +++ b/package.json @@ -171,6 +171,7 @@ "storybook": "start-storybook -p 3000 -c src/storybook/", "build-storybook": "build-storybook -c src/storybook/ -o build/storybook", "test": "jest src/", - "test-e2e": "testcafe 'chrome:headless' .testcafe" + "test-e2e": "testcafe 'chrome:headless' .testcafe", + "heroku-postbuild": "npm run build" } } diff --git a/static.json b/static.json new file mode 100644 index 000000000..24f3f239f --- /dev/null +++ b/static.json @@ -0,0 +1,7 @@ +{ + "root": "build/dashboard/", + "https_only": true, + "routes": { + "/**": "index.html" + } +}