Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erabossid/code-bank
This a code flashback project to retrieve codes in the memory
https://github.com/erabossid/code-bank
Last synced: about 1 month ago
JSON representation
This a code flashback project to retrieve codes in the memory
- Host: GitHub
- URL: https://github.com/erabossid/code-bank
- Owner: erabossid
- License: mit
- Created: 2020-09-25T17:29:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-27T16:29:03.000Z (over 4 years ago)
- Last Synced: 2024-11-15T01:44:17.991Z (about 2 months ago)
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# code-bank
A simple document page to code flashback to refresh the memory whenever needed## Post data with axios
```
const dataToSend = {
field1:'value1',
field2:'value2'
}
axios.post('url-here', dataToSend)
.then(d=>window.alert('submitted'))
.catch(err=>window.alert('submission failed'))
```
## Get data with axios
```
axios.get('url-here')
.then(res=>{
let data = res.data;
// do something with data
})
.catch(err=>console.log(err));
```## Update data with axios (put)
```
const updateData = {
field1:'updated f1 value',
field2:'updated f2 value'
}axios.put('url-here', updateData)
.then(d=>window.alert('updated'))
.catch(err=>window.alert('update failed'))
```
## Delete data with axios
```
const id = 'id-to-delete....';
axios.delete(`url-here/${id}`)
.then(d=>window.alert('deleted'))
.catch(err=>window.alert('failed'))
```