Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/understanding-astro/astro-middleware-examples
- Owner: understanding-astro
- Created: 2023-08-18T06:22:30.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-14T04:37:42.000Z (over 1 year ago)
- Last Synced: 2024-11-19T23:39:06.570Z (2 months ago)
- Topics: astro, astrojs, jwt, middleware
- Language: Astro
- Homepage:
- Size: 181 KB
- Stars: 65
- Watchers: 0
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 |