We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05c71b2 commit 768040bCopy full SHA for 768040b
2 files changed
package.json
@@ -4,6 +4,7 @@
4
"description": "React with fetch API Maps - Republica do CEP",
5
"main": "index.js",
6
"dependencies": {
7
+ "axios": "^0.18.0",
8
"bootstrap": "^4.3.1",
9
"react": "^16.8.4",
10
"react-dom": "^16.8.4",
src/services/index.js
@@ -0,0 +1,22 @@
1
+import axios from 'axios'
2
+
3
+const instance = axios.create({
+ baseURL: 'http://localhost:3003'
+})
+instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
+const postCreated = (description) => {
+ return instance({
11
+ method: 'post',
12
+ data: {
13
+ description: description
14
+ },
15
+ url: '/api/v1'
16
+ })
17
+ .then(resp => resp)
18
+}
19
20
+export default {
21
+ postCreated
22
0 commit comments