Node.js Express Minify JSON Online Converter Full Web App Deployed to Live Website 2020

Node.js Express Minify JSON Online Converter Full Web App Deployed to Live Website 2020



Welcome folks I am back with another blog post we will be building a JSON Minifer Online Converter web app full tutorial 2020. All the source code of the application is shown below


Live Demo


You can see the live demo of the website here


Get Started


In order to make the application you need to install these node dependencies


npm init -y


npm i express ejs


Now make the index.ejs and copy paste the following code



<div class="container">
          <h1 class="text-center">
              Minify JSON Online
          <form action="/" method="post">
            <div class="form-group">
              <label for="json">JSON Code:</label>
                <textarea rows="10" cols="30" class="form-control" type="file" name="json" id="" placeholder="Paste your JSON Code here" required></textarea>
            <div class="form-group">
                <button class="btn btn-block btn-danger">
                    Minify JSON




Now make the index.js file and copy paste the following code

See also  Deno.js Tutorial to Capture Webpage Screenshot as PNG Image in Headless Mode Using deno-shot Library in TypeScript Full Project For Beginners



const express = require('express')
const bodyParser = require('body-parser')

const fs = require('fs')

const app = express()


const PORT = 3001

app.set('view engine','ejs')

app.get('/',(req,res) => {
    res.render('index',{title:'Minify JSON Code Online - Best JSON Online Minifer Tool -'})
})'/',(req,res) => {
    var json = req.body.json

    var minifiedjson = JSON.stringify(JSON.parse(json));

    var outputjson = + "output.json"

    fs.writeFileSync(outputjson,minifiedjson),(err) => {
        if(err) {
            res.send("Unable to download the file")

app.listen(PORT,()=> {
    console.log(`App is listening on Port ${PORT}`)









Leave a Reply