forked from CaliCastle/cali.so
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
942591f
commit 445da4d
Showing
14 changed files
with
199 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
## 我的个人网站 | ||
|
||
## Getting Started | ||
目前还在开发中,可以通过 [https://cali.so/](https://cali.so/) 访问。 | ||
|
||
First, run the development server: | ||
需要其他服务商的环境变量才能正常运行,所以如果你想要在本地运行,需要自己配置。 | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. | ||
|
||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. | ||
### 技术栈 | ||
|
||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. | ||
- [Next.js](https://nextjs.org/) | ||
- [React](https://reactjs.org/) | ||
- [TypeScript](https://www.typescriptlang.org/) | ||
- [Tailwind CSS](https://tailwindcss.com/) | ||
- [Framer Motion](https://www.framer.com/motion/) | ||
- [Radix UI](https://www.radix-ui.com/) | ||
- [Sanity](https://www.sanity.io/) | ||
|
||
## Learn More | ||
### 本地开发 | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
```bash | ||
# 安装依赖 | ||
pnpm install | ||
|
||
## Deploy on Vercel | ||
# 启动开发服务器 | ||
pnpm dev | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
# 构建 | ||
pnpm build | ||
``` | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. | ||
通过 [Vercel](https://vercel.com/) 一键部署。 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import cors from 'edge-cors' | ||
import { NextResponse } from 'next/server' | ||
import { getTweet } from 'react-tweet/api' | ||
|
||
type RouteSegment = { params: { id: string } } | ||
|
||
export async function GET(req: Request, { params }: RouteSegment) { | ||
try { | ||
const tweet = await getTweet(params.id) | ||
return cors( | ||
req, | ||
NextResponse.json({ data: tweet ?? null }, { status: tweet ? 200 : 404 }) | ||
) | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} catch (error: any) { | ||
return cors( | ||
req, | ||
NextResponse.json( | ||
{ error: error.message ?? 'Bad request.' }, | ||
{ status: 400 } | ||
) | ||
) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { type Component, type ReactNode } from 'react' | ||
|
||
type ReactJSXElementConstructor<Props> = | ||
| ((props: Props) => ReactNode | Promise<ReactNode>) | ||
| (new (props: Props) => Component<Props, any>) | ||
|
||
declare global { | ||
namespace React.JSX { | ||
type ElementType = string | ReactJSXElementConstructor<any> | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.