grand-stack / grand-stack-starter

Simple starter project for GRANDstack full stack apps

Home Page:https://grandstack.io/docs/getting-started-grand-stack-starter.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warnings when starting app using api-only

johnymontana opened this issue · comments

If I select API only when running npm run start I notice warnings in the output:

> node scripts/start-dev.js

08:02:06 API-Only | /bin/sh: line 0: cd: /Users/lyonwj/tmp/foobaaaaah/api-only: No such file or directory
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start exited with code 1
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start restarted
08:02:06 API-Only | /bin/sh: line 0: cd: /Users/lyonwj/tmp/foobaaaaah/api-only: No such file or directory
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start exited with code 1
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start restarted
08:02:06 API-Only | /bin/sh: line 0: cd: /Users/lyonwj/tmp/foobaaaaah/api-only: No such file or directory
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start exited with code 1
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start restarted
08:02:06 API-Only | /bin/sh: line 0: cd: /Users/lyonwj/tmp/foobaaaaah/api-only: No such file or directory
08:02:06 API-Only | cd /Users/lyonwj/tmp/foobaaaaah/api-only && yarn run start exited with code 1
yarn run v1.22.10
$ cross-env DEBUG=neo4j-graphql-js ./node_modules/.bin/nodemon --watch src --ext js,graphql --exec babel-node  src/index.js
08:02:07 api | [nodemon] 1.19.4
08:02:07 api | [nodemon] to restart at any time, enter `rs`
08:02:07 api | [nodemon] watching dir(s): src/**/*
08:02:07 api | [nodemon] watching extensions: js,graphql
08:02:07 api | [nodemon] starting `babel-node src/index.js`
08:02:10 api | GraphQL server ready at http://0.0.0.0:4001/graphql

this is caused by looking for a frontend project to start called api-only. To fix this add some logic here that if the config is api-only to only start the api project:

https://github.com/grand-stack/grand-stack-starter/blob/master/scripts/start-dev.js#L11-L31