Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aitthi/astro-surf

Astro Surf is a server side rendering library for Astro built with Axum
https://github.com/aitthi/astro-surf

astro napi-rs rust

Last synced: about 1 month ago
JSON representation

Astro Surf is a server side rendering library for Astro built with Axum

Awesome Lists containing this project

README

        

# Astro Surf

[![NPM version](https://img.shields.io/npm/v/astro-surf.svg?style=for-the-badge)](https://www.npmjs.com/package/astro-surf)

[Astro](https://astro.build/) Surf is a server side rendering library for Astro built with [Axum](https://github.com/tokio-rs/axum)

## Installation

```bash
npm install astro-surf
```
or
```bash
yarn add astro-surf
```

## Usage

```js
import AstroSurf from "astro-surf";
import { handler as astroApp } from "./dist/server/entry.mjs";

async function main() {
console.log('Starting app...');
process.env.NODE_ENV = 'production';
let app = AstroSurf.initialize(astroApp, {
client_path: `${process.cwd()}/dist/client`
});
await app.serve(3000)
}
main();

```