JavaScript - create & deploy the project on MDB GO

How to deploy & host JavaScript app - tutorial & free hosting

This guide will take you step by step on how to create your project and deploy using MDB CLI.


Java Script

Create a project

Create a new directory called my-js-app. You can do it using command line

        
            
              $ mkdir my-js-app
        
        
    

Open project in editor (i.e. VS Code), create index.html and create your app. You can open project from terminal:

        
            
              $ cd my-js-app
              $ code .
        
        
    

Sample JS code:

        
            
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      alert("Hello world!");
    </script>
  </body>
</html>

                  
        
    

Publish

Once you finish building your project, use the following command to deploy it:

        
            
              $ mdb frontend publish
        
        
    

Note: Since frontend is a default value for publish command, you can run just mdb publish (instead of mdb frontend publish )

If you are publishing for the first time, CLI will ask you few initial questions like

  • Whether you want to use npm or yarn?
  • What is your project name, version, description, github address and license

Once you successfully publish your project they will be stored for a future.