Last active
March 17, 2021 17:38
-
-
Save kuc-arc-f/2881ad008af264025abd2b87a6207b6c to your computer and use it in GitHub Desktop.
axios, strapi post sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"@babel/preset-env" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "app12", | |
"version": "0.0.0", | |
"private": true, | |
"scripts": { | |
"start": "nodemon --exec babel-node ./bin/www" | |
}, | |
"dependencies": { | |
"axios": "^0.21.1" | |
}, | |
"devDependencies": { | |
"@babel/core": "^7.11.1", | |
"@babel/node": "^7.10.5", | |
"@babel/preset-env": "^7.11.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function test2(){ | |
var item = { | |
title: "t34", | |
content : "c34" | |
} | |
var d = await axios.post('http://localhost:1337/tasks' | |
,item | |
) | |
console.log(d) | |
} | |
// main | |
console.log("#main") | |
test2() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment