umijs / umi-blog-example Goto Github PK
View Code? Open in Web Editor NEWAn example of blog website built with Umi.js and new API route feature in Umi 4.
Home Page: https://umijs.org/docs/tutorials/blog
An example of blog website built with Umi.js and new API route feature in Umi 4.
Home Page: https://umijs.org/docs/tutorials/blog
部署到 vercel 上是一键式的,什么都不用操作,但是如果我想部署到其他的平台呢,或者是自己的服务器呢?有没有相关的教程呀,或者给点提示也行。
我说一下目前的思路,既然是 serverless 的,那我可以自己安装一下 serverless 环境,剩下的就是如何在这个环境下部署所有的 api 了,应该有相关的命令或者脚本,我查了一下 vercel deploy umijs,里面只说了流程并没有提到具体的部署细节,找不到其他资料了
各位大佬。我在执行完 npx prisma migrate dev --name init
之后,出现了报错。报错信息是:
Error: P3014
Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases. Read more about the shadow database (and workarounds) at https://pris.ly/d/migrate-shadow
Original error:
create database is not supported
0: migration_core::state::DevDiagnostic
at migration-engine/core/src/state.rs:251
想请问各位大佬应该怎么解决呀?谢谢你们!!
大佬好,我想请教下 @/utils/jwt这个是什么安装包,vscode显示找不到模块
我目前是用jwt生成的 token jwt.sign()
我在umi框架里写的api接口怎么改请求里的response headers里的contentType为application/json
`import type { UmiApiRequest, UmiApiResponse } from "umi";
import fs from "fs";
import path from "path";
export default async function (req: UmiApiRequest, res: UmiApiResponse) {
switch (req.method) {
case "GET":
try {
const { id } = req.body;
const mdxPath = path.join(
process.cwd(),
"src/mdxFile",
${20231127}.mdx
);
const mdxContent = fs.readFileSync(mdxPath, "utf8");
res
.status(200)
.header("Content-Type", "application/json")
.json({ content: mdxContent });
} catch {
res.status(500).header("Content-Type", "application/json").json({
result: false,
message: "报错",
});
}
break;
}
}`
\api\posts[postId].js:53190
throw new Error("Unable to find environment variable: UPSTASH_REDIS_REST_URL
");
Error: Unable to find environment variable: UPSTASH_REDIS_REST_URL
const redis = Redis.fromEnv()
The above code seems to need to configure an environment variable, but I don't know what to use.
您好,我按照您的教程自己也部署了一套,页面正常,但是api请求不正常,我也有在vercel上正确配置环境变量。这是我部署的地址:https://cp-blog-umi.vercel.app/ ,当我进行api请求时返回的是一个html文档,
这种情况应该是Serverless没有成功部署,尚不清楚出错原因,我的项目地址是https://github.com/XiaoPingzi-Anhui/cp-blog-umi ,这个项目在我本地是正常运行的,本地请求正常,大佬们看看哪里出了问题,如何让部署在vercel上的项目请求正常
请求/api/register报500错误,不知道从哪看报错信息
目前参看教程可以搭建一个博客系统,请问哪里可以查看更多文档呢,我想在 apiRoute 里返回一些资源的的地址,比如音视频地址之类的,请问如何做的?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.