惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
L
LangChain Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
腾讯CDC
GbyAI
GbyAI
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
F
Fortinet All Blogs
Y
Y Combinator Blog
V
V2EX
A
About on SuperTechFans

Deno

Deno 2.8 | Deno Claw Patrol: an open-source security firewall for agents | Deno Fresh 2.3: Zero JS by default, View Transitions, and Temporal support | Deno Deno 2.7: Temporal API, Windows ARM, and npm overrides | Deno Build a dinosaur runner game with Deno, pt. 6 | Deno Build a dinosaur runner game with Deno, pt. 5 | Deno Deno Deploy is Generally Available | Deno Introducing Deno Sandbox | Deno Build a dinosaur runner game with Deno, pt. 4 | Deno Build a dinosaur runner game with Deno, pt. 3 | Deno Build a dinosaur runner game with Deno, pt. 2 | Deno React / Next.js Denial-of-Service Vulnerability: Deno Deploy users protected | Deno Deno 2.6: dx is the new npx | Deno Build a dinosaur runner game with Deno, pt. 1 | Deno React Server Functions / Next.js Vulnerability: Deno Deploy users protected | Deno My highlights from the new Deno Deploy | Deno Deno's Other Open Source Projects | Deno How Deno protects against npm exploits | Deno Help Us Raise $200k to Free JavaScript from Oracle | Deno Deno 2.5: Permissions in the config file | Deno Fresh 2.0 Graduates to Beta, Adds Vite Support | Deno Deno 2.4: deno bundle is back | Deno JavaScript™ Trademark Update | Deno What's coming to JavaScript | Deno A brief history of JavaScript | Deno Reports of Deno's Demise Have Been Greatly Exaggerated | Deno An Update on Fresh | Deno How Plaid migrated 100 services to a new database platform 5x faster with Deno | Deno Deno 2.3: Improved deno compile, local npm packages, and more | Deno Add JSR packages with pnpm and Yarn | Deno
Run your Next.js SSR app on Deno Deploy | Deno
2024-12-02 · via Deno

Next.js is a powerful metaframework built on top of React that simplifies the process of building server-rendered or statically generated web applications. You can use Next.js in Deno, but what about getting it to work on Deno Deploy, our globally distributed serverless JavaScript platform?

Until now, only static Next.js sites (SSG) could be deployed into Deno Deploy. Today we are announcing the additional support for server-side rendering of Next.js apps! In this blog post, we’ll show you how to deploy a Next.js app with SSR on Deno Deploy from both linking a GitHub repo and via the command line:

  • Connect a GitHub repo
  • From the command line with deployctl
  • What’s next?

🚨️ Deno 2.1 was just released, with first-class Wasm support, Long Term Support, improved package management, and more. Tune into our livestream tomorrow at 8am PT / 11am ET / 4pm UTC where the Deno team demos and discusses the biggest updates in 2.1.

Connect a GitHub repo

Linking your GitHub repo is the easiest way to deploy any project to Deno Deploy.

If you have your Next.js app as a GitHub repo, you can follow these steps to get that published to Deno Deploy. Deno Deploy will automatically detect and build Next.js apps configured with both the default and the “standalone” output.

ℹ️ If your app uses the default output configuration, Deno Deploy will use jsr:@deno/nextjs-start as entrypoint, which calls next start with the options exposed as env variables

  1. Fork this template or use an existing Next.js app with output: "standalone" configured in next.config.ts.
  2. Go to https://dash.deno.com/new_project. If you do not have a Deno Deploy account, you will asked to sign up with your GitHub account for free.
  3. Search for your Next.js project in the repository in the dropdown menu. Deno Deploy will automatically detect that you are using Next.js and prepare the necessary build configuration.
Deno Deploy will automatically detect your Next.js project and prepare the necessary build configuration.
  1. Click “Deploy project”. Deno Deploy will commit to your repository and run the new deploy.yml action, which will build and deploy your project on every push to the main branch. Note that afterwards you are free to customize the action by editing the .github/workflows/deploy.yml file.
  2. Your project is now live!

From the command line with deployctl

If you prefer managing deployments from the command line, you can also use deployctl. This CLI can manage the entire deployment lifecycle of your projects, from creating a new project, tail streaming logs, promoting a previous deployment to production, and more. It also enables you to interface with Deno Deploy from a build environment like CI.

  1. If you don’t yet have deployctl, you can download it with the following command:
deno install -gArf jsr:@deno/deployctl
  1. In the root of your Next.js project, build your app:

Deno recognizes package.json. Learn more about Deno’s Node and npm compatibility.

  1. Finally, deploy to Deno Deploy:
deployctl deploy --include=.next --include=public jsr:@deno/nextjs-start/v15

The deploy command uses the JSR package jsr:@deno/nextjs-start/v15, which enables the use of next start in Deno Deploy. If you are running Next.js version 14, then you can use jsr:@deno/nextjs-start.

  1. Your project is now live!
deployctl deploy --include=.next --include=public jsr:@deno/nextjs-start/v15

⚠ No project name or ID provided with either the --project arg or a config file.
ℹ Provisioning a new access token... 
ℹ Authorization URL: https://dash.deno.com/signin/cli?claim_challenge=sj_eanwPi9woFjoXKbX51mh9IuOrEOTjoCJ7mf8sj8o
✔ Token obtained successfully
✔ Created new project 'cold-owl-38'
ℹ You can always change the project name with 'deployctl projects rename new-name' or in https://dash.deno.com/projects/cold-owl-38/settings
✔ Deploying to project cold-owl-38.
ℹ The project does not have a deployment yet. Automatically pushing initial deployment to production (use --prod for further updates).
ℹ Uploading all files from the current dir (/private/tmp/nextjs)
✔ Found 96 assets.
✔ Uploaded 97 new assets.
✔ Production deployment complete.
✔ Created config file 'deno.json'.

View at:

- https://cold-owl-38.deno.dev
- https://cold-owl-38-ge5wzec92q25.deno.dev

Note that if you prefer to use the standalone output and want to deploy via command line, you can follow these steps.

What’s next

Now that your Next.js app is on Deno Deploy, there is much more you can do:

🚨️ Deno 2.1 was just released 🚨️

and much more!

Tune into our livestream tomorrow at 8am PT / 11am ET / 4pm UTC where the Deno team demos and discusses the biggest updates in 2.1.