Hello.
I've been using openlitespeed for a long time. I love it and I am a big supporter.
I used php and node applications in my projects that I published on Openlitespeed.
I would like to share with you a mistake I discovered.
As you can see, instead of the normal .js extension, there is a .mjs extension. .mjs stands for es modules.
I discovered this error after I started using Nuxt v3.
After building my Nuxt 3 application, I wanted to run the server file as a node.js application on openlitespeed. But the page did not open.
Then I created an empty index.mjs file and writed the sample code block from the openlitespeed site's "Node.js Apps With OpenLiteSpeed" page and wrote it in.
Unfortunately it still didn't work. It worked fine when I changed the extension of the file to .js. But when I changed it back to .mjs it didn't work.
I solved my problem by creating proxy for now.
But when we want to use proxy for each application, we will always need to use unique port.
This is a temporary solution for me. But I am sure you will solve this problem in a short time.
I wish the developer team all the best. Thank you for the OpenLiteSpeed project.
I've been using openlitespeed for a long time. I love it and I am a big supporter.
I used php and node applications in my projects that I published on Openlitespeed.
I would like to share with you a mistake I discovered.
As you can see, instead of the normal .js extension, there is a .mjs extension. .mjs stands for es modules.
I discovered this error after I started using Nuxt v3.
After building my Nuxt 3 application, I wanted to run the server file as a node.js application on openlitespeed. But the page did not open.
Then I created an empty index.mjs file and writed the sample code block from the openlitespeed site's "Node.js Apps With OpenLiteSpeed" page and wrote it in.
JavaScript:
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World form node js app.js\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
I solved my problem by creating proxy for now.
But when we want to use proxy for each application, we will always need to use unique port.
This is a temporary solution for me. But I am sure you will solve this problem in a short time.
I wish the developer team all the best. Thank you for the OpenLiteSpeed project.