代码拉取完成,页面将自动刷新
Image compression full stack website code. Contains both api service and frontend written in node, react and next.js framework.
gcloud
command line tool (download here) or set GOOGLE_APPLICATION_CREDENTIALS
env variable with the service account file.
.env
file in the root of the folder with the following variables. See dotenv on how to add env variables.
1
(optional).your-google-cloud-bucket-name
[YOUR-API-URL]/1/dl
npm install
to install all node modules for api.npm run dev
to start the dev server on 3000
port.npm start
for productionnpm install
to install all node modules for frontend.npm run dev
will start the webpack server on 3001
port.npm run build
and npm start
to build and use the code in production.Following programs are used for optimization
Current file size upload limit is 10MB.
API Routes. [POST]
/image
: upload image(s) via file, URL, base64 or Binary.
file
or base64
or binary
.Boolean
(default: false)/url
: Compression direct image url.
/zip
: Accepts list of files object as an array with (id
, size
and name
) and send the zipped result.
[GET]
- /dl/:id
: Generate download url of compressed image. Accept optional query name
.
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。