Search code examples
htmlwebuploadpug

How to upload a website without an html files


H! I have created a website, where all the files are of the type CSS, js, pug, and when I want to publish the site, I need to give an index.html file from which the site will start. The problem is that I do not have such a file. Does anyone know how to deal with such a problem? And in addition, I started the site by running it in localhost: 3000 does anyone know how to start it now so that it will work when I upload it. Thanks in advance to all the helpers.


Solution

  • Your mention of localhost:3000 implies that you have written a website which depends on Node.js for server-side code (at a minimum this will involve the translation of your Pug templates into HTML on demand).

    There are two general approaches you can take to solve this problem:

    1. Find hosting which supports your server-side code and deploy your Node.js application to it. (This will not be typical static or shared hosting).
    2. Generate static HTML documents from your application and upload those HTML documents. (The specifics will depend on exactly what your server-side implementation does and will probably be a significant amount of work. Typically if you wanted to take this approach, you would have used a framework designed to output static sites from the outset).

    Obviously if you have your server-side code processing user input (such as form submissions) option 2 will not work.