Skip to content

Commit

Permalink
chore: update module names (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored Apr 26, 2024
1 parent 182c6e9 commit 8d8dac2
Show file tree
Hide file tree
Showing 9 changed files with 3,520 additions and 2,682 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# @deno/astro-adapter

## 0.1.0

- Renamed to @deno/astro-adapter [deno-astro-adapter/pull/15](https://github.com/denoland/deno-astro-adapter/pull/15)


# @astrojs/deno

## 5.0.0
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @astrojs/deno 🦖
# @deno/astro-adapter

This adapter allows Astro to deploy your SSR site to Deno targets.

Expand All @@ -19,12 +19,15 @@ If you're using Astro as a static site builder—its behavior out of the box—y

If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/guides/server-side-rendering/), Astro requires an adapter that matches your deployment runtime.

[Deno](https://deno.land/) is a runtime similar to Node, but with an API that's more similar to the browser's API. This adapter provides access to Deno's API and creates a script to run your project on a Deno server.
[Deno](https://deno.com/) is a runtime similar to Node, but with an API that's more similar to the browser's API. This adapter provides access to Deno's API and creates a script to run your project on a Deno server.

## Installation

Add the Deno adapter to enable SSR in your Astro project with the following `astro add` command. This will install the adapter and make the appropriate changes to your `astro.config.mjs` file in one step.


<!-- TODO(kt3k): Update `astro add deno` in the upstream -->

```sh
# Using NPM
npx astro add deno
Expand All @@ -39,15 +42,15 @@ If you prefer to install the adapter manually instead, complete the following tw
1. Install the Deno adapter to your project’s dependencies using your preferred package manager. If you’re using npm or aren’t sure, run this in the terminal:

```bash
npm install @astrojs/deno
npm install @deno/astro-adapter
```

1. Update your `astro.config.mjs` project configuration file with the changes below.

```js ins={3,6-7}
// astro.config.mjs
import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';
import deno from '@deno/astro-adapter';

export default defineConfig({
output: 'server',
Expand Down Expand Up @@ -99,7 +102,7 @@ To configure this adapter, pass an object to the `deno()` function call in `astr
```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';
import deno from '@deno/astro-adapter';

export default defineConfig({
output: 'server',
Expand All @@ -115,7 +118,7 @@ This adapter automatically starts a server when it is imported. You can turn thi

```js
import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';
import deno from '@deno/astro-adapter';

export default defineConfig({
output: 'server',
Expand All @@ -128,10 +131,9 @@ export default defineConfig({
If you disable this, you need to write your own Deno web server. Import and call `handle` from the generated entry script to render requests:

```ts
import { serve } from 'https://deno.land/[email protected]/http/server.ts';
import { handle } from './dist/server/entry.mjs';

serve((req: Request) => {
Deno.serve((req: Request) => {
// Check the request, maybe do static file handling here.

return handle(req);
Expand All @@ -144,7 +146,7 @@ You can set the port (default: `8085`) and hostname (default: `0.0.0.0`) for the

```js
import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';
import deno from '@deno/astro-adapter';

export default defineConfig({
output: 'server',
Expand Down
Loading

0 comments on commit 8d8dac2

Please sign in to comment.