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
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); |
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
server { | |
location / { | |
# MODX babel rewrites | |
rewrite ^/(en|de)/css(.*)$ /css$2 break; | |
rewrite ^/(en|de)/js(.*)$ /js$2 break; | |
rewrite ^/(en|de)/img(.*)$ /img$2 break; | |
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
<?php | |
// Dan Gibbs | |
// Clear MODx Revolution Cache (2.1 and later) | |
// Path to MODx Core Directory | |
define("MODX_CORE_PATH", "../core/"); | |
define("MODX_CONFIG_KEY", "config"); | |
// Include MODx main class | |
include(MODX_CORE_PATH . "model/modx/modx.class.php"); |