Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dario-piotrowicz/next-on-pages-custom-wrapper-example
https://github.com/dario-piotrowicz/next-on-pages-custom-wrapper-example
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dario-piotrowicz/next-on-pages-custom-wrapper-example
- Owner: dario-piotrowicz
- Created: 2024-03-20T19:38:02.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-20T19:47:38.000Z (8 months ago)
- Last Synced: 2024-04-18T06:19:59.023Z (7 months ago)
- Language: CSS
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# next-on-pages custom wrapper example
This is a very simple example of how a custom wrapper can be applied on top of the worker generated by `@cloudflare/next-on-pages`, so that the next-on-pages request handler can be expended/modified and custom logic can be added before/after it.
## Steps
Install the dependencies:
```
$ npm i
```Build and preview the application:
```
$ npm run preview
```In the terminal notice the `My Custom Handler!` logs, those come from the `worker.ts` file
You can then modify the `worker.ts` file in any way to then add any logic you want to the request handling.