XingLuo

我亦是行人

历史上的今天

回顾历史,铭记过去

加载中...
加载每日新闻...

Back

Deployment Mode

Vercel

This theme supports Vercel by default:

  1. Push your code to your online Git repository (GitHub, GitLab, BitBucket).
  2. Import your project into Vercel.
  3. Vercel will automatically detect Astro and configure the right settings.
  4. Your application is deployed! (e.g. astro.vercel.app)

And vercel also support static method:

astro.config.mjs
import vercelServerless from '@astrojs/vercel/serverless'
import vercelStatic from '@astrojs/vercel/static'; 

export default defineConfig({
  //   ...
  adapter: vercelServerless() 
  adapter: vercelStatic(), 
})
ts

Static

If you are deploying with Node.js locally, you need to install @astrojs/node first:

bun add '@astrojs/node'
shell

Then follow the comments in astro.config.ts and modify like:

astro.config.ts
import vercelServerless from '@astrojs/vercel/serverless'
import node from '@astrojs/node'

export default defineConfig({
  //   ...
  adapter: vercelServerless() 
  adapter: node({ mode: 'standalone' }) 
})
ts

GitHub Pages

See Astro: Configure Astro for GitHub Pages.