Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/understanding-astro/astro-middleware-examples

✨ Practical Astro middleware examples from Basic auth to JWT auth and more.
https://github.com/understanding-astro/astro-middleware-examples

astro astrojs jwt middleware

Last synced: 8 days ago
JSON representation

✨ Practical Astro middleware examples from Basic auth to JWT auth and more.

Awesome Lists containing this project

README

        

![Demo](https://i.imgur.com/dKpBx5G.png)

# Astro Middleware Examples

- [Hello world](https://github.com/understanding-astro/astro-middleware-examples/tree/master/hello-world)
- [Locals object](https://github.com/understanding-astro/astro-middleware-examples/tree/master/locals-object)
- [Basic Auth](https://github.com/understanding-astro/astro-middleware-examples/tree/master/basic-auth)
- [JWT Auth](https://github.com/understanding-astro/astro-middleware-examples/tree/master/jwt-auth)
- [Redirects](https://github.com/understanding-astro/astro-middleware-examples/tree/master/redirect)
- [Multiple middleware](https://github.com/understanding-astro/astro-middleware-examples/tree/master/multiple-middleware)
- [Feature flag (PostHog)](https://github.com/understanding-astro/astro-middleware-examples/tree/master/feature-flag-posthog)
- Coming soon ...

## 🧞 Commands

Change directory to the required example and run any of the following commands from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |