Skip to content

Commit

Permalink
fix: removed '@cocreate/acme' as it is now handled by '@cocreate-srever'
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jan 3, 2024
1 parent c98d12d commit ca81282
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const hosts = {};
class CoCreateLazyLoader {
constructor(server, crud, files) {
this.server = server
// this.acme = server.acme
this.wsManager = crud.wsManager
this.crud = crud
this.files = files
Expand Down Expand Up @@ -47,14 +46,13 @@ class CoCreateLazyLoader {
});
}

this.server.https.on('request', (req, res) => this.request(req, res, 'HTTPS'))
this.server.http.on('request', (req, res) => this.request(req, res, 'HTTP'))
this.server.https.on('request', (req, res) => this.request(req, res))
this.server.http.on('request', (req, res) => this.request(req, res))

}

async request(req, res, protocol) {
async request(req, res) {
try {
console.log('server', protocol)
const valideUrl = new URL(`http://${req.headers.host}${req.url}`);
const hostname = valideUrl.hostname;

Expand Down Expand Up @@ -84,8 +82,6 @@ class CoCreateLazyLoader {

hosts[hostname] = organization

// await this.acme.checkCertificate(hostname, organization._id, req.url)

if (valideUrl.pathname.startsWith('/webhooks/')) {
let name = req.url.split('/')[2]; // Assuming URL structure is /webhook/name/...
if (this.modules[name]) {
Expand Down

0 comments on commit ca81282

Please sign in to comment.