Giter Site home page Giter Site logo

next-telegraph-image's Introduction

启动本地服务

启动本地服务

npm install

npm run dev

部署

非常建议创建个vercel账号部署到vercel,个人使用额度几乎是用不完的。点一下下面按钮就开始部署了

Deploy with Vercel

跨域接口测试

function testCors() {
  var ipt = document.createElement("input");
  ipt.type = "file";
  ipt.onchange = (e) => {
    const form = new FormData();
    form.append("file",ipt.files[0])
    fetch("http://localhost:3000/upload", {
      body: form,
      method: "POST",
      mode: "cors",
    })
      .then((res) => res.json())
      .then((res) => {
        console.log(res);
      });
  };
  ipt.click()
}

图片预览问题

直接使用的nextjs rewrites 配置代理到源图地址。 因为走[nousedfile]这个路由的时候 会遇到GZIP压缩图片问题。导致图片显示不完整。

开启资源审查

https://moderatecontent.com/申请了key以后填写到.env.production 开启审查
本地环境是 .env.local 文件

立即申请资源审查KEY

资源审查不可以原因!!!

在vercel环境下。middleware使用了 edge runtime,无法读取 node环境变量。所以还是建议fork过去之后 在代码里面修改。

next-telegraph-image's People

Contributors

righit avatar

Watchers

 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.