This adapter allows you to easily integrate Chopin to non-Next.js projects.
- Host your non-Next.js project on a server with a domain name (i.e.
your-project.com,your-project.herokuapp.com, etc.) - Deploy this project to Vercel with your desired domain name. This will be how users will access your project.
- Set the
DESTINATION_URLenvironment variable to the location that your non-Next.js project is hosted on. It must be a full URL (e.g.https://your-project.com) and cannot be an IP address. - Recommended: Create a secret password that this server will use when talking to your destination server. This ensures that nobody can talk to your destination server without going through this gateway. Set the
SEQUENCER_SECRETenvironment variable to the secret key of your sequencer. If you set this value, you must also implement middleware on your destination server that checks for this header.
If you did step 4, you must check for the x-sequencer-secret header in your destination server. If it is not present, you should return a 401 Unauthorized status.
For example, if you are using Express, your middleware should look like this:
app.use((req, res, next) => {
if (!req.headers['x-sequencer-secret'] || req.headers['x-sequencer-secret'] !== process.env.SEQUENCER_SECRET) {
return res.status(401).send('Unauthorized');
}
next();
});