Code Monkey home page Code Monkey logo

img2color-go's Introduction

Img2color

本项目使用go作为基础,具有较高的性能

支持vercel与服务器部署

vercel部署

  1. 点击项目右上角fork叉子

  2. 登录vercel

  3. vercel导入项目

  4. 部署时添加环境变量

  5. 国内访问需绑定自定义域名

服务器部署

需要go环境

  1. 安装依赖
go mod tidy
  1. 运行
go run /api/img2color.go

此处不赘述守护进程。

使用

例如:https://img2color-go.vercel.app/api?img=https://npm.elemecdn.com/[email protected]/img/post/banner/神里.webp

部署后只需要 域名/api 访问

必填参数img: url

.env文件配置说明

配置项 说明
REDIS_ADDRESS REDIS地址
REDIS_PASSWORD REDIS密码
USE_REDIS_CACHE bool值,是否启用REDIS
REDIS_DB REDIS数据库名
USE_MONGODB bool值,是否启用mongodb
MONGO_URI mongodb地址
MONGO_DB mongodb数据库名
PORT 端口
ALLOWED_REFERERS 允许的refer域名,支持通配符,如果有多个地址可以用英文半角,隔开

img2color-go's People

Contributors

anzhiyu-c avatar tianli0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.