Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 4 #10

Merged
merged 18 commits into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
- name: Install, test and lint backend
working-directory: ./backend
run: |
touch .env
echo JWTSECRET=$JWTSECRET >> .env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
touch .env
echo JWTSECRET=$JWTSECRET >> .env

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use dotenv or dotenv-flow you can overwrite those values specified in .env with your current process.env.

Have you tried deleting .env and then run your sever with:

$ JWTSECRET=whatever yarn run dev

This should work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review Robert. As I cant comment your review message I have to write it here. We actually did request a mentors-review in the first week of the exercise, so maybe the notification didnt work as expected.
image

npm install
npm run test
npm run lint
env:
CI: true
CI: true,
JWTSECRET: ${{ secrets.JWTSECRET }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the only necessary line of code.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
backend/node_modules
backend/node_modules
backend/.env
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ This is the homework repository for the group Felni from Felix and Nicolas.

### Exercise 3:

- Link to folder: [Apollo GraphQL Backend](./backend)

### Exercise 4:

- Link to folder: [Apollo GraphQL Backend](./backend)
3 changes: 3 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Apollo Backend

## Mandatory for running tests ´
Create a .env file in the root backend folder and add a secret JWTSECRET for signing the JWT token (e.g. JWTSECRET=yoursecret)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also check in a .env.template with dummy secrets and then tell the user to

$ cp .env.template .env

this file.


## Project setup
```
npm install
Expand Down