Skip to content

Commit

Permalink
Added script to create ".env" file
Browse files Browse the repository at this point in the history
  • Loading branch information
juliolmuller committed Mar 11, 2021
1 parent 2196a8f commit f1debdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,17 @@ This application was proposed by [Juno](https://www.juno.com.br/), as part of th

## :hammer: Setting up the Environment

To execute the application, you must have a Marvel Developer account and have the **public** and **private** keys generated. Once you have them, you will have to register both as environment variables in a `.env` file, at project root (use `.env.example` as reference to know all the required variables to be set).
Make sure to have **Node.js 10+** installed in your machine and its **npm** available in the command line, then use the following command to install dependencies:

Make sure to have **Node.js 10+** installed in your machine and its **npm** available in the command line, then use the following routines:
```bash
$ npm install
```

To execute the application, you must have a Marvel Developer account and have the **public** and **private** keys generated. Once you have them, you will have to register both as environment variables in a `.env` file, at project root. If it wasn't created after installation process, use `.env.example` as reference to know all the required variables to be set.

At last, you can use the following commands to run the application:

```bash
$ npm install # Download dependencies
$ npm start # Run development server
$ npm run build # Build files for production
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"author": "Julio L. Muller",
"homepage": "https://juliolmuller.github.io/marvel-characters",
"scripts": {
"postinstall": "node -e \"require('fs').existsSync('.env') || require('fs').copyFileSync('.env.example', '.env')\"",
"start": "react-app-rewired start",
"build": "rm -rf docs/ && react-app-rewired build && mv build/ docs/",
"test": "react-app-rewired test",
Expand Down

0 comments on commit f1debdd

Please sign in to comment.