Node JSPowerShell

Build API and Web App using Node JS, PowerShell and PUG

I haven’t seen any new applications developed without REST API associated with it. Many vendors spend time to help developers who work on integrations. Lets see how we can use Node JS, PUG and PowerShell to share a web app and RESTful API

Our end-goal is to meet the below requirement

RESTful API

Web Application

Just below steps will help us to achieve the needs!

  1. Install node
  2. npm install express -s
  3. npm install pug -s
  4. npm install body-parser -s

PowerShell Script to query MYSQL

Note: You can use mysql package and achieve the same (For other infra needs I should or MUST use PowerShell and for a demo I picked mysql database)

Now here comes the node (employeeRecord.js) code

PUG (Intended HTML body)

For API – I created another route!

 

Output!

It’s easy! Enjoy PowerShell with Node JS

Leave a Reply

Your email address will not be published. Required fields are marked *