diff --git a/README.md b/README.md index 4f0278fc5..c4fc61a98 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ You will need the following: 0. Give permission to create a database* 0. `rake db:create:all db:migrate db:seed` 0. (optional) Verify installation with `RAILS_ENV=test rake db:create db:migrate && rspec spec` (API) and `npm run test` (Frontend). - 0. Start server with `npm run dev`. Make sure you set an `MQTT_HOST` entry in `application.yml` pointing to the IP address or domain of MQTT server. If you are not running the MQTT server on a separate machine, `MQTT_HOST` and `API_HOST` will point to the same server. + 0. Start server with `rails api:start`. Make sure you set an `MQTT_HOST` entry in `application.yml` pointing to the IP address or domain of MQTT server. If you are not running the MQTT server on a separate machine, `MQTT_HOST` and `API_HOST` will point to the same server. 0. Start MQTT with `rails mqtt:start`. **Important note:** You may be required to enter a sudo because [docker requires root access](https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface). 0. Open [localhost:3000](http://localhost:3000). 0. [Raise an issue](https://github.com/FarmBot/Farmbot-Web-App/issues/new?title=Installation%20Failure) if you hit problems with any of these steps. *We can't fix issues we don't know about.* diff --git a/lib/tasks/api.rake b/lib/tasks/api.rake new file mode 100644 index 000000000..cfb00c440 --- /dev/null +++ b/lib/tasks/api.rake @@ -0,0 +1,7 @@ +namespace :api do + desc "TODO" + task start: :environment do + sh "PORT=3000 bundle exec foreman start --procfile=Procfile.dev" + end + +end diff --git a/package.json b/package.json index 9230966f2..f671e0f0c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build": "TARGET=production bundle exec rake webpack:compile", "start": "echo '===We use `npm run dev` now.==='", "heroku-postbuild": "webpack --config=./config/webpack.prod.js", - "dev": "PORT=3000 bundle exec foreman start --procfile=Procfile.dev", + "dev": "rails api:start", "webpack": "./node_modules/.bin/webpack-dev-server --config config/webpack.config.js --host 0.0.0.0", "test": "jest --coverage --no-cache", "typecheck": "tsc --noEmit --jsx preserve"