1.3.21 • Published 20 days ago
wph-proxy-next v1.3.21
Proxy with NextJS
Required dependencies
npm install cookies-next
Environment variables
- Need to add following environment variables to your
NextJS App
NEXT_PUBLIC_API_URL=your_api_url
NEXT_PUBLIC_API_TOKEN=your_api_token
Setup script
- Create a file named
setup.js
at root folder (or anywhere in you project) - Copy following code and paste into the file
const {initApiInstance, generateApiRoutes} = require('wph-proxy-next');
initApiInstance(process.env.NEXT_PUBLIC_API_URL, process.env.NEXT_PUBLIC_API_TOKEN);
generateApiRoutes(path.join(__dirname, "your-target-directory"));
Run script
- Add a custom script to
package.json
to executesetup.js
file
For example:
"start": "node setup.js"
- Run this script before you build your
NextJS App
to populate api handlers
1.3.21
20 days ago
1.3.19
21 days ago
1.3.20
21 days ago
1.3.17
1 month ago
1.3.18
1 month ago
1.3.13
1 month ago
1.3.14
1 month ago
1.3.12
1 month ago
1.3.15
1 month ago
1.3.16
1 month ago
1.3.10
1 month ago
1.3.11
1 month ago
1.3.9
2 months ago
1.3.8
3 months ago
1.3.7
3 months ago
1.3.6
3 months ago
1.3.5
3 months ago
1.3.4
3 months ago
1.3.3
8 months ago
1.3.2
8 months ago
1.3.1
8 months ago
1.3.0
8 months ago
1.2.9
8 months ago
1.2.8
8 months ago
1.2.7
8 months ago
1.2.6
8 months ago
1.2.5
8 months ago
1.2.4
8 months ago
1.2.3
8 months ago
1.2.2
8 months ago
1.2.1
8 months ago
1.2.0
8 months ago
1.1.9
9 months ago
1.1.8
9 months ago
1.1.7
9 months ago
1.1.6
9 months ago
1.1.5
9 months ago
1.1.4
9 months ago
1.1.3
9 months ago
1.1.2
9 months ago
1.1.1
9 months ago
1.1.0
9 months ago
1.0.9
9 months ago
1.0.8
9 months ago
1.0.7
9 months ago
1.0.6
9 months ago
1.0.5
9 months ago
1.0.4
9 months ago
1.0.3
9 months ago
1.0.2
9 months ago
1.0.1
9 months ago
1.0.0
9 months ago