// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
🏄♂️
This file contains hidden or 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
import { DataSource, Entity, PrimaryGeneratedColumn, Column, OneToMany, ManyToOne, JoinColumn, RelationId, Repository, QueryRunner, EntityManager, DeepPartial, SaveOptions } from "typeorm"; | |
/** | |
* Post Entity | |
*/ | |
@Entity("posts") | |
class Post { | |
@PrimaryGeneratedColumn() | |
id!: number; |
This file contains hidden or 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
const links = [ | |
// random | |
"https://www.google.com/maps/@-6.1619199,106.8530092,15.76z?entry=ttu", | |
// unmatch url | |
"https://facebook.com/@-6.1619199/area", | |
// marchan clicked | |
"https://www.google.com/maps/place/TanSu+Kemayoran/@-6.1619199,106.8530092,15.76z/data=!4m6!3m5!1s0x2e69f5bb8fcb8b41:0xec7e3f7c984200a4!8m2!3d-6.1608762!4d106.8493247!16s%2Fg%2F11fxdvf1k9?entry=ttu", |
This file contains hidden or 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
node_modules | |
vendor |
This file contains hidden or 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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |