What should be the contents of the app.js file?

2 replies · opened Jan 21, 2024

Ooffice33Jan 21, 2024

I purchased hosting, installed NodeJS from cPanel

When entering the keepitsimple.bg domain, Hello World is written - set by app.js

I have uploaded all the necessary files to the "keepitsimple/public" directory

Can you make it so that when the domain keepitsimple.bg is opened - the "/keepitsimple/public" directory is opened?

What should be the contents of the app.js file?

app.js:

var http = require("http");

http.createServer(function (request, response) {
   // Send the HTTP header 
   // HTTP Status: 200 : OK
   // Content Type: text/plain
   response.writeHead(200, {'Content-Type': 'text/plain'});
   
   // Send the response body as "Hello World"
   response.end('Hello World\n');
}).listen();

I am attaching 2 images of the directories and the app.js file

SSemicolon WebSTAFFJan 24, 2024

Hello,

Thanks for your Patience!

Using Gulp/NodeJS is only required on the Local System if you are doing advanced editing like editing the SCSS Files or making optimizations. If you are not doing any of those, then we recommend using the Files directly by editing the Files using VS Code, then upload the Files as mentioned here: https://docs.semicolonweb.com/docs/getting-started/installation/ using FTP. That's it. App.js is not required.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard