Skip to content

Commit

Permalink
criando variaveis de ambiente
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeblobo committed Apr 24, 2021
1 parent ffdc795 commit 2d201a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL=https://my-json-server.typicode.com/felipeblobo/devtalk
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"server": "json-server server.json -w -d 750 -p 3333"
"server": "json-server db.json -w -d 750 -p 3333"
},
"dependencies": {
"axios": "^0.21.1",
"date-fns": "^2.21.1",
"dotenv": "^8.2.0",
"next": "10.1.3",
"rc-slider": "^9.7.2",
"react": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/services/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';

const api = axios.create({
baseURL: 'http://localhost:3333/'
baseURL: process.env.API_URL || 'http://localhost:3333/'
})

export default api;
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,11 @@ dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"

dotenv@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==

duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
Expand Down

1 comment on commit 2d201a3

@vercel
Copy link

@vercel vercel bot commented on 2d201a3 Apr 24, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.