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

推荐订阅源

T
Threat Research - Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
Recorded Future
Recorded Future
The Register - Security
The Register - Security
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
Webroot Blog
Webroot Blog
Help Net Security
Help Net Security
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tailwind CSS Blog
J
Java Code Geeks
C
CXSECURITY Database RSS Feed - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone
小众软件
小众软件
G
Google Developers Blog
SecWiki News
SecWiki News
V
V2EX
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
S
Security Affairs
AI
AI
S
Securelist
D
Docker
人人都是产品经理
人人都是产品经理
T
Troy Hunt's Blog
罗磊的独立博客
The Hacker News
The Hacker News
阮一峰的网络日志
阮一峰的网络日志
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
P
Proofpoint News Feed
Vercel News
Vercel News
Jina AI
Jina AI

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Astro 5.16 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13 What's new in Astro - July 2025 Astro 5.12 Starlight 0.35 Astro 5.11 What's new in Astro - June 2025 Live Content Collections: A Deep Dive Introducing… Astro Mart Astro Solstice Festival Astro 5.10 Astro 5.9 What's new in Astro - May 2025 Astro 5.8 What's new in Astro - April 2025 2025 Technical Steering Committee Starlight April Update Astro 5.7 Astro Agency Partner Program Astro 5.6 What's new in Astro - March 2025 Astro 5.5 What's new in Astro - February 2025 Astro 5.4 Starlight 0.32 Astro 5.3 What's new in Astro - January 2025 Astro 5.2 2024 year in review What's new in Astro - December 2024 Astro 5.1 Astro 5.0 Google IDX: Our Official Online Editor Partner What's new in Astro - November 2024 What's new in Astro - October 2024 Astro x Cloudinary SDK What's new in Astro - September 2024 Community Loaders for Astro Content Layer Astro x Hygraph: Content Loader Astro x Cloudinary: Content Loader Astro x Storyblok: Content Loader Content Layer: A Deep Dive Starlight 0.28 Astro 5.0 Beta Release The $100,000 Astro Ecosystem Fund Fall Update Goodbye Studio, Hello DB What's new in Astro - August 2024 Astro 4.15 Astro 4.14 Astro 4.13 What's new in Astro - July 2024 Astro 4.12: Server Islands Netlify: Our Official Deployment Partner What's new in Astro - June 2024 Astro 4.11 Astro Together 2024 Server Islands The Astro Content Layer Zero-JavaScript View Transitions Astro 4.10 Starlight turns one year old! What's new in Astro - May 2024 Astro 4.9 Astro 4.8 What's new in Astro - April 2024 Astro 4.7 Astro 4.6 What's new in Astro - March 2024 Migrating 500+ tests from Mocha to Node.js Astro DB: A Deep Dive The Astro Developer Portal Astro DB
Astro 1.5.0 Release
Matthew Phillips · 2022-10-13 · via The Astro Blog

Astro 1.5.0 just went out and it features:

  • Adapter support for astro preview: Adapters can now support astro preview.
  • Standalone mode in Node.js adapter: The Node.js adapter now can build to a standalone server.
  • HMR for Tailwind and TypeScript config: The dev server will now automatically reload on Tailwind config and tsconfig changes.
  • API Endpoint improvements: The API route APIContext object now matches the Astro global more closely.
  • Astro.redirect status code: You can now optionally pass a status code when using Astro.redirect.

You can update your projects by running npm install astro@latest.

Adapter support for astro preview

We are rolling out support for the astro preview command in adapters via a new integration option, starting with the Node.js adapter @astrojs/node. If you are using @astrojs/node, you can now preview your SSR app by running:

Adapter API

We will be updating the other first party Astro adapters to support preview over time. Adapters can opt-in to this feature by providing the previewEntrypoint via the setAdapter function in astro:config:done hook. The Node.js adapter’s code looks like this:

export default function() {

return {

name: '@astrojs/node',

hooks: {

'astro:config:done': ({ setAdapter, config }) => {

setAdapter({

name: '@astrojs/node',

serverEntrypoint: '@astrojs/node/server.js',

previewEntrypoint: '@astrojs/node/preview.js',

exports: ['handler'],

});

// more here

}

}

};

}

Standalone mode in Node.js adapter

New in @astrojs/node is support for standalone mode. With standalone mode, you can start your production server without needing to write any server JavaScript logic yourself. The server starts simply by running the script like so:

node ./dist/server/entry.mjs

To enable standalone mode, set the new mode option to 'standalone' in your Astro config:

import { defineConfig } from "astro/config"

import nodejs from "@astrojs/node"

export default defineConfig({

output: "server",

adapter: nodejs({

mode: "standalone",

}),

})

See the @astrojs/node documentation for all of the options available in standalone mode.

Existing @astrojs/node users who are using their own HTTP server framework such as Express can upgrade by setting the mode option to 'middleware' in order to build to a middleware mode, which is the same behavior and API as before.

import { defineConfig } from "astro/config"

import nodejs from "@astrojs/node"

export default defineConfig({

output: "server",

adapter: nodejs({

mode: "middleware",

}),

})

HMR for Tailwind and TypeScript config

HMR is vitally important even at the beginning stages of a project. In a recent Astro release we ensured that changes to your astro.config.mjs file resulted in an automatic server restart. Today we are expanding our support for HMR with other configuration files.

Now, editing your tsconfig.json settings (for example, to add an alias) results in an HMR update.

Similarly, Tailwind configuration file changes now update as well. Just edit your tailwind.config.(js|cjs|mjs) file and the changes will reflect without the need to restart your dev server.

We’re continuing to focus on HMR and the dev experience in upcoming releases.

API Endpoint improvements

In API routes, you can now get the site, generator, url, clientAddress, props, and redirect fields on the APIContext, which is the first parameter passed to an API route. This was done to make the APIContext more closely align with the Astro global in .astro pages.

For example, here’s how you might use the clientAddress, which is the user’s IP address, to selectively allow users.

export function post({ clientAddress, redirect }) {

if (!allowList.has(clientAddress)) {

return redirect("/not-allowed")

}

}

Check out the docs for more information on the newly available fields.

Astro.redirect status code

New in 1.5 is the ability to pass a status code to Astro.redirect. By default it uses 302, but now you can pass another code as the second argument:

/src/pages/old-post.astro

---

// This page was moved, redirect the user to the new permanent page.

return Astro.redirect("/posts/new-post-name", 301)

---


This release also comes with many bug fixes. Thanks to everyone who has contributed to another outstanding release. See the release notes for full details on the changes.