Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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.