Deploy application on Windows instance

Deploy application on Microsoft Windows Server 2022 instance

  1. NPM stands for Node package manager is a tool to create and manage Javascript programming libraries for Node.js. Using npm init to initialize the project will generate a sample package.json file.
npm init

create vpc for linux instance

  1. Complete the application’s information configuration

create vpc for linux instance

  1. Next we do the dependencies installation
npm install express dotenv express-handlebars body-parser mysql
  • express
  • Dotenv
  • express-handlebars
  • body-parser
  • mysql

create vpc for linux instance

  1. Use Visual Studio Code to open the source code and create a .env file used to configure the database.
DB_HOST = 'localhost'
DB_NAME = 'DB_NAME'
DB_USER = 'root'
DB_PASS = 'password'

Since it is a practical lab, we use the root user with a blank password. When you build or install a database-driven application, you typically create a database service user for that application and avoid using the root account for anything but database administration. data.

create vpc for linux instance

  1. Restart the Express server. Use Nodemon to save time.
npm install --save-dev nodemon

create vpc for linux instance

  1. Start the local server
npm start

create vpc for linux instance

  1. Open a browser and go to localhost:5000

create vpc for linux instance

  1. Add user information to the database

create vpc for linux instance

  1. Access the application interface again

create vpc for linux instance