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
FROM node:16-alpine | |
WORKDIR /usr/src/app | |
# install dependencies | |
COPY package*.json ./ | |
COPY packages/shared/package*.json ./packages/shared/ | |
COPY packages/collector/package*.json ./packages/collector/ | |
COPY packages/frontend/package*.json ./packages/frontend/ | |
RUN npm ci |
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
__d( | |
'useThrottledImpl', | |
['cr:1708227'], | |
function (a, b, c, d, e, f, g) { | |
'use strict'; | |
g['default'] = b('cr:1708227'); | |
}, | |
98 | |
); | |
__d( |
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 axios from 'axios'; | |
import fs from 'fs'; | |
import path from 'path'; | |
async function downloadImageAsAxiosStream(url: string, filename: string) { | |
// Fetch the image | |
const response = await axios({ | |
url, | |
method: 'GET', | |
responseType: 'stream' |
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 fileUrl = new URL(`/api/files/${fileId}/content`, API_URL); | |
const url = new URL('/api/images', API_URL); | |
url.pathname += `/webp`; | |
url.pathname += `/${params.width ?? 0}`; | |
url.pathname += 'x'; | |
url.pathname += `${params.height ?? 0}`; | |
url.pathname += `/filters:format(${params.extension ?? 'png'})`; | |
url.pathname += `/${fileUrl}`; |
OlderNewer