Данная пошаговая инструкция поможет освоить основы на простом примере
Для справки
Сервер поднимался на Debian 8
c характеристиками:
CPU - 1 ядро x 500 МГц
const ejs = require('ejs'); | |
const fs = require('fs'); | |
module.exports = ({template, config}) => { | |
fs.readFile(template, 'utf8', (err, data) => { | |
if (err) { console.log(err); return false; } | |
var ejs_string = data, | |
template = ejs.compile(ejs_string), | |
html = template(config); | |
fs.writeFile(template.replace('.ejs', '') + '.html', html, (err) => { | |
if(err) { console.log(err); return false } |
declare module 'dialogflow-fulfillment' { | |
import { DialogflowConversation } from 'actions-on-google'; | |
import { Request, Response } from 'express'; | |
export class Card extends RichResponse { | |
constructor(card: string | object); | |
public setButton(button: { | |
text: string, | |
url: string, |
#!/bin/bash | |
# Remove unused instances | |
dead_instances="$(docker ps -aq -f status=exited)" | |
[ "$dead_instances" ] && docker rm $dead_instances | |
# Remove unused images | |
dead_images="$(docker image ls | awk '/^<none> +<none>/ { print $3 }')" | |
[ "$dead_images" ] && docker rmi $dead_images |
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); |