Learn how to integrate Bolt.new AI with Let's Encrypt. Follow our step-by-step guide to secure your AI workflow with SSL encryption.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
package.json
file.greenlock-express
in your dependency list. Since Bolt.new AI does not allow terminal installations, ensure the dependency is specified here.package.json
:
{
"name": "bolt-new-ai-app",
"version": "1.0.0",
"main": "server.js",
"dependencies": {
"express": "^4.17.1",
"greenlock-express": "^4.0.3"
}
}
server.ts
in the root directory of your Bolt.new AI project.greenlock-express
package.server.ts
:
import express from 'express';
import * as GreenlockExpress from 'greenlock-express';
const app = express();
// Your application routes
app.get('/', (req, res) => {
res.send("Hello, secure world with Let's Encrypt!");
});
// Configure Greenlock for automatic SSL certificate generation/renewal
const greenlock = GreenlockExpress.create({
// ACME server version, using draft-11 for current Let's Encrypt support
version: 'draft-11',
// Directory to store configuration & certificates; ensure the directory exists or Greenlock will create it
configDir: './greenlock.d',
// Contact email for important account notifications
email: 'your-email@example.com',
// Automatically agree to the Let's Encrypt Subscriber Agreement
agreeTos: true,
// Whether to run Greenlock as a community member (set false if you do not want telemetry)
communityMember: false,
// List the domains you want to secure with Let's Encrypt
approveDomains: ['yourdomain.com']
});
// Start the server: listen on HTTP port 80 and HTTPS port 443
greenlock.listen(80, 443, () => {
console.log("Server is running and SSL certificates are managed by Let's Encrypt");
});
server.ts
as the main file.server.ts
is included.package.json
if needed. For example:
"scripts": {
"start": "tsc && node build/server.js"
}
[email protected]
and yourdomain.com
with your actual email and domain name in the server.ts
file.When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.