Node Js Simple Weather App Using Darksky API - Node Js Tutorial

July 31, 2019 Add Comment

Hi, after coping with my real life and those 'tiring' daily activities, finally I can write again.
in this tutorial I will share with you guys how to access darksky api using node js.

Node Js Simple Weather App Using Darksky API, weather app node js, node js darksky, darksky api, node js weather app simple
Node Js Simple Weather App Using Darksky API 

Node Js Simple Weather App Using Darksky API 

What module we need to accees ?

as we are going to access the API from other site and make http request, a module called request is needed. What is request module for node js ? according to stackabuse.com,  The request module is by far the most popular (non-standard) Node package for making HTTP requests. It means that HTTP requests with Node.js are a means for fetching data from a remote source. It could be an API, a website, or something else: at one point you will need some code to get meaningful data from one of those remote sources - valentinog.com.

And what is Darksky API ?

Darksky API is one of API provider for weather forecast. Why Darksky API ? because its it can be configured easily in minutes, developer friendly, clear and concise documentation. It also provides forecasts and current conditions, global coverage, historical data, and severe weather alerts

Here is the example of Node Js Simple Weather App Using Darksky API


const request = require('request')

const url = 'https://api.darksky.net/forecast/8593f986c0f88727f3270a097ee4b90c/37.8267,-122.4233?units=si'
//'https://api.darksky.net/forecast/8593f986c0f88727f3270a097ee4b90c/37.8267,-122.4233' to customize add ? followed with the keyvalue=value
//example 'https://api.darksky.net/forecast/8593f986c0f88727f3270a097ee4b90c/37.8267,-122.4233?units=si&ang=id'
//read https://darksky.net/dev/docs

const getWeather = () => {
    request({ url: url, json: true }, (error, response) => { //json true to enable automatic json parsing
        // const data = JSON.parse(response.body) // it is used if json option is not enabled / json: not true ..which is to change json string to json
        // console.log(response.body)
        console.log(`overall, the weather today is ${response.body.currently.summary} with the temperature of ${response.body.currently.temperature} celcius `)
        console.log(`and right now is ${response.body.minutely.summary} .. and current precip intensity is ${response.body.minutely.data[0].precipIntensity}`)
    })
}

getWeather()



you can see in my github for more:

I hope it can be useful for you :)

Tag: Node Js Simple Weather App Using Darksky API, weather app node js, node js darksky, darksky api, node js weather app simple

Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

July 21, 2019 Add Comment

Javascript is a programming language that you must learn if you want to explore the world of web development.

Currently javascript is not only used on the client (browser) side. Javascript is also used on servers, consoles, desktop programs, mobile, IoT, games, and others.

This makes javascript more popular and becomes the most used language on Github. According to hybridtechcar.com, JavaScript is the most used programming language in 2018.

JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
programming trends - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

In this article, we will learn Javascript from the basic. Starting from the introduction of Javascript, to make the first program with Javascript.

Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

What is JavaScript ?

Javascript is a programming language that was originally designed to run on a browser.

However, as time goes by, javascript does not only run on the browser. Javascript can also be used on the server side, games, IoT, desktop, etc.

Javascript was originally called Mocha, then changed to LiveScript when the browser Netscape Navigator 2.0 was released in beta (September 1995). However, after that it was renamed Javascript.

Inspired by the success of Javascript, Microsoft adopted a similar technology. Microsoft made their own version of 'JavaScript' called JScript. Then planted on Internet Explorer 3.0.

This has resulted in 'browser wars', because Microsoft's JScript is different from Netscape's Javascript.

Tools To Learn JavaScript

What are the equipment that must be prepared to learn Javascript?
1. Web Browser (Google Chrome, Firefox, Opera, etc.)
2. Text Editor (recommendation: VS Code)

That is all?

Yes, that's enough. If you want to learn Javacript from Nodejs, please read: Introduction to Nodejs for Beginners.

My recommendation: learn Javascript from the client side first. and thenNodejs later.

Get to know the JavaScript Console

Some say, learning javascript is difficult, because when you see the results in a web browser, the error message does not appear. This opinion is incorrect. Because we can see it through the console.

We can open the Javascript Console through Inspect Element-> Console.

Inside the console, we can write functions or javascript codes and the results will be immediately displayed.

For example, let's try the following code:

console.log("Hi apa kabar!");
alert("Saya sedang belajar javascript");

Then the results will be like
When we write console.log(''learn javascript)
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
console in browser - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

and if we write alert('javascript is easy), here is the outcome
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
console in browser and pop up alert - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

If you use Nodejs, then how to access the console is to type the command node in the Terminal. we can see like the picture below.
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
using node js in console - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

However, in order to be able to run node, we have to install nodejs first. Please read How to Install Node Js

After trying the Javascript console, we can conclude that:
1. The console can be used to test functions or Javascript code;
2. We can use the Console to see error messages when debugging programs.

Creating the First Javascript Program

Already know how to open and use a javascript console?

Nice…

Then, let's create the first program with Javascript.

Please open the text editor, I strongly recommend you to use Visual Studio Code. Then create a file called helloWorld.html and write in the following code:

<!DOCTYPE html>
<html>

<head>
    <title>Hello World Javascript</title>
</head>

<body>
    <script>
        console.log("now I love Javascript@");
        document.write("Hello World!");
    </script>
</body>

</html>

if you are using Visual studio code the image will be like this
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
hello world html - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial
Please save it with the name helloWorld.html, then open the file with a web browser.
and the result will be like ..
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
result from helloWorld.html - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

Wait a minute ...

Remember that we wrote the command:
console.log("now I love Javascript!");

Why isn't it displayed?

Because the command or function console.log() will display messages in the javascript console. While the document.write() command functions to write to an HTML document, then it will be displayed there.

Now just open the javascript console.

Then we will see the message "now I love Javascript!"
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
result in console - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial


Cool!

Now, what we need to know next is:

How to write Javascript code in HTML?

In the example above, we have written javascript code in HTML.

This method is an embeded method.

There are still some more ways that we need to know:
1. Embed (Javascript code pasted directly on HTML. Example: the one before)
2. Inline (Javascript code written in HTML attributes)
3. External (Javascript code is written separately from HTML file)

Let's look at an example ...

1. Writing javascript code with Embed

In this way, we use the <script> tag to embed the Javascript code in HTML. This tag can be written in the <head> and <body> tags.

Example:

<!DOCTYPE html>
<html>

<head>
    <title>learn Javascript from basic</title>
    <script>
        // this is how to write javascript code
        // inside <head> tag
        console.log("Hello, this is JavaScript from Head");
    </script>
</head>

<body>
    <p>Tutorial Javascript for beginner</p>
    <script>
        // this is how to write javascript code
        // inside <body> tag
        console.log("Hello, this JavaScript from body");
    </script>
</body>

</html>

Which is better, write the javascript code in <head> or <body>?

Many says that writing it in <body> is better, because it will make the web load faster.

2. Writing inline javascript code

In this way, we will write the javascript code in the HTML attribute. This method is usually used to call a function for a particular event.

For example: when the link is clicked -> we want something to happen if we click it

Example:
<a href="#" onclick="alert('Yey!')">click me!</a>

Or that can also be like this
<a href="javascript:alert('Yey!')">Click me!</a>

You can put the code inside the helloWorld.html

<!DOCTYPE html>
<html>

<head>
    <title>Learn Javascript from the basic</title>
    <script>
        // this is how to write javascript code
        // inside <head> tag
        console.log("Hello, this is JavaScript from Head");
    </script>
</head>

<body>
    <p>Javascript tutorial for beginner</p>
    <script>
        // this is how to write javascript code
        // inside <body> tag
        console.log("Hello, this JavaScript from body");
    </script>

    <a href="#" onclick="alert('Yey!')">click me!</a>
    <a href="#" onclick="alert('Yey!')">click me again!</a>
</body>

</html>

and the result will be like this
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
result in browser - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial

Look...

In the onclick and href attributes we write the javascript function there.

The onclick attribute is an HTML attribute to declare a function that will be executed when the element is clicked.

In the example above, we run the alert () function. This function is a function for displaying dialogs.

Then in the href attribute, we also call the alert () function with javascript:

The href attribute is actually used to fill in the link address or URL.

Because we want to call the javascript code there, then we change the link address to javascript: then followed by the function to be called.

3. Writing External JavaScript Code

In this way, we will write the javascript code separately with the HTML file.

This method is usually used on large projects, because it is believed - in this way - it can more easily manage the project code.

Let's look at an example ...

We create two files, HTML and Javascript files.
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
folder structure - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial
inside external.js we can write:
alert("Hello, this is from Javascript external");

from helloWorld.html :
<! DOCTYPE html>
<html>
    <head>
        <title> Learning JavaScript from Zero </title>
    </head>
    <body>
        <p> JavaScript Tutorial for Beginners </p>

        <!-- Insert external js code -->
        <script src="external.js"> </script>
    </body>
</html>

And the result will be like this
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
result in browser - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial
In the example above, we write separate javascript code with HTML code.

Then, in the HTML code ...

We insert it by giving the src attribute to the <script> tag.
<!-- embed javascript external code -->
<script src="external.js"></script>

So, anything in the external.js file will be read from the helloWorld.html file.

What if the javascript file is in a different folder?
We can write the full address of the folder.

Example:
Suppose we have a folder structure like this:
JavaScript Tutorial - Introduction to Basic JavaScript & First Step to Learn JavaScript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript, learn javascript, learn javascript for beginner, javascript for beginners, how to learn javascript for beginners, javascript examples, javascript introduction, javascript tutorial, javascript for beginner, javascript for beginners udemy, javascript syntax, learn javascript
folder structure - Introduction to Basic JavaScript & First Step to Learn JavaScript - JavaScript Tutorial
So to insert the external.js file into HTML, we can write it like this:
<script src="javascript/external.js"></script>

Because the external.js file is in the javascript directory.

We can also insert javascript on the internet by providing the full URL address.
<script src="https://www.pengelanamuslim.com/javascript/code.js"></script>

What is next?
Congratulations 🎉

You already know JavaScript and have made the first program with Javascript.

Of course this is not enough ...

We still have to learn a lot about Javascript. InshaAllah, I will try to write more about javascript tutorials.. . see you!
source: petanikode.com

Examples of Yargs Module in Node Js - Node Js Tutorial

July 19, 2019 Add Comment

After writing article about Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner and Using fs (File System) Module in Node js to Write and Read File - Node Js Tutorial , now in this article I am going to share about the use of Yargs. Just heard about yargs ?. Me too.

Node Js Tutorial - Examples of Yargs Module in Node Js

yargs is one of the famous javascript module. Yargs helps us build interactive command line tools, by parsing arguments and generating an elegant user interface.

Ok so, let's try together what can we do with this nodejs module, Yargs.

install yargs
npm install yargs

make a folder containing 2 files
Examples of Yargs Module in Node Js - Node Js Tutorial
yargs files

yargs.js file - Node Js Tutorial - Yargs Examples

yargs.js contains yargs command. Later we will run this file.

const yargs = require('yargs')
const note = require('./yargfunction')

//EXAMPLE TO WRITE 
yargs.command({
    command: 'add', // set the command
    describe: 'to add data', //give description
    builder: { //set the builder -- it contains the key to sore the value
        title: {
            demandOption: true, //required?
            type: 'string',
            describe: 'this is the title'
        },
        content: {
            type: 'string',
            demandOption: true,
            describe: 'this is the content'

        }
    },
    handler: function (argv) { //handler is the place we can put function
        console.log(`title: ${argv.title}, conten: ${argv.content}`)
    }
})

//EXAMPLE 2 - TO WRITE
yargs.command({
    command: 'mymessage',
    describe: 'maybe you need to say hello first',
    builder: {
        message: {
            type: 'string',
            demandOption: 'required'
        }
    },
    handler: function (argv) {
        if (argv.message == "hello") {
            console.log(`oh you say ${argv.message} ? hiiiii :*`)
        } else {
            console.log(`why you don't say hello first ??`)

        }
    }

})

// EXAMPLE 3 CREATE and UPDATE JSON FILE USING FS and Yargs
yargs.command({
    command: 'addJSONFile',
    describe: 'function to add json file',
    builder: {
        title: {
            type: 'string',
            describe: 'this is the title'
        },
        content: {
            type: 'string',
            describe: 'this is the content'
        }
    },
    handler: function (argv) {
        //call function from yargfunction.js
        note.addNote(argv.title, argv.content)
    }
})

//Update JSON
yargs.command({
    command: 'updateJSONFile',
    describe: 'this is to update existing json file',
    builder: {
        thefilename: {
            type: 'string',
            demandOption: true,
            describe: 'this is the filename'
        },
        updatedTitle: {
            type: 'string',
            demandOption: true,
            describe: 'this is the titile'
        },
        updatedContent: {
            type: 'string',
            demandOption: true,
            describe: "this is the content content"
        }
    },
    handler: function (argv) {
        //The name of the variable argv stands for "argument vector". A vector is a one-dimensional array, and argv is a one-dimensional array of strings. Each string is one of the arguments that was passed to the program. source: crasseux.com
        //call function from yargfunction.js
        note.updateNote(argv.thefilename, argv.updatedTitle, argv.updatedContent)
    }
})

yargs.parse() // to parse the result

yargfunction.js file - Node Js Tutorial - Yargs Examples

yargfunction.js is the file containing functions that are needed to run one command in yargs,js file.

const fs = require('fs')

//addnote function
const addNote = function (title, content) { //set the parameter
    const rawData = {
        title: title,
        content: content
    }
    const toJsonstring = JSON.stringify(rawData) //make the objevt becomes json form in string
    fs.writeFileSync('yarg.json', toJsonstring) //use fs function to create a file and insert data (toJsonString variable)
}

//update function
const updateNote = function (thefilename, title, content) {
    const readFileBuffer = fs.readFileSync(`${thefilename}`) //read the file
    const stringIt = readFileBuffer.toString() // change the readFileBuffer to string, because the result of readFileBuffer is in binary
    console.log(stringIt)

    const makeItJsonObject = JSON.parse(stringIt) //convert the json string to object, so we will be able to modify the value
    console.log(makeItJsonObject)

    //set the change
    makeItJsonObject.title = title
    makeItJsonObject.content = content
    console.log(makeItJsonObject)

    const stringitagain = JSON.stringify(makeItJsonObject) //after changing the value, then we can convert it again to json string
    console.log(stringitagain)

    fs.writeFileSync(`${thefilename}`, stringitagain) // and finally we can rewrite the file with the new data
}

module.exports = { addNote, updateNote }

Simple example

1. Make simple note

in this first example we are going to create yargs command to record our input through console. 

how to run it?
open console and run :
node yarg.js add --title="YOUR_TITLE" --content="YOUR_CONTENT"

if we run that command the result will be shown in the console
FIrst example of yargs - Examples of Yargs Module in Node Js - Node Js Tutorial


2.Combining yargs with else if condition

in this example I am going to use yargs to return values regarding the input.

how to run it
open console and run:
node yarg.js mymessage --message="easy ?"

The result will be like this
second example of yargs - Examples of Yargs Module in Node Js - Node Js Tutorial

3. Creating Json file using yargs and update it

first we will add a json file and write a json value. you can write the code like below
third example of yargs - Examples of Yargs Module in Node Js - Node Js Tutorial
third example of yargs - Examples of Yargs Module in Node Js - Node Js Tutorial

then, we can see that the json file is already created and inside the file there are some lines of code of json. yarg.json is resulted from the yargfunction.js.
yarg.json - Examples of Yargs Module in Node Js - Node Js Tutorial

if we want to update it, we can use this command (like beow image)
Examples of Yargs Module in Node Js - Node Js Tutorial, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs
update commnd yargs - Examples of Yargs Module in Node Js - Node Js Tutorial

then if we see the json file, it will change automatically.

Examples of Yargs Module in Node Js - Node Js Tutorial, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs
yarg.json - Examples of Yargs Module in Node Js - Node Js Tutorial

I hope it can be useful. You can check about this simple project in my github : https://github.com/ZenHuzaini/nodejs-yargs-examples

Tag :
nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, Examples of Yargs Module in Node Js - Node Js Tutorial, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs, how to use yargs nodejs, yargs module in nodejs, nodejs, yargs, yargs examples, yargs for nodejs, how to use yargs nodejs, yargs module in nodejs

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner (Part 7 - finish)

July 17, 2019 Add Comment

After we finished trying to test our API through Postman, now as I promised you, I will implement the view using bootstrap.

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner 

Ok, now we have to install bootstrap and jquery first
npm install bootstrap
npm intsall jquery
Once finished installing those two modules, now we have to set the resource folder in app.js
we can add these several lines of code
//set folders for resources
app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js')); // redirect bootstrap JS
app.use('/jsjquery', express.static(__dirname + '/node_modules/jquery/dist')); // redirect JS jQuery
app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css')); // redirect CSS bootstrap

So, the full codes of app.js would be like this
const express = require('express');
const mongoose = require('mongoose');
require('dotenv/config');
const app = express();
const bodyparser = require('body-parser');
const path = require('path');

//view engine
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

//set folders for resources
app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js')); // redirect bootstrap JS
app.use('/jsjquery', express.static(__dirname + '/node_modules/jquery/dist')); // redirect JS jQuery
app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css')); // redirect CSS bootstrap


// allow to use body parser
app.use(bodyparser.json());
app.use(bodyparser.urlencoded({ extended: false }));

//routes 
app.get('/', async (req, res) => {
    res.redirect('/notes')
});

//load routes
const notes_route = require('./routes/notes');

//middleware
app.use('/notes', notes_route);

//connect database
mongoose.connect(process.env.MYCONNECTION,
    { useNewUrlParser: true },
    () => console.log('yeay connected!'));

//this is to listen the port
const port = process.env.PORT;
app.listen(port, function () {
    console.log('the server runs at ' + port);
});

Now we will implement the views for this simple web app. First we need to make a folder named views and after that create 2 files like below image

Tag : Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner
view folder


File note_home.ejs
This view is to show user the lists of notes we already created


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- load bootsrtap -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
    </div>
    <div class="container">
        <h1>Simple Note using Node Js Express, MongoDb and Bootstrap</h1>
        <hr>
        <a href="/"><button class="btn btn-primary">Home</button></a>
        <hr>
        <div class="row">
            <div class="col-md-8 mb-5">
                <h2>List Notes</h2>
                <table class="table table-borderless">
                    <thead>
                        <tr>
                            <th scope="col">#</th>
                            <td>Title</td>
                            <td>Content</td>
                            <th scope="col">action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <% for(var i = 0; i < notes.length; i++) { %>
                        <tr>
                            <th scope="row"><%= i+1 %> </th>
                            <td><%= notes[i].title %></td>
                            <td><%= notes[i].content %></td>
                            <td><a href="notes/<%= notes[i]._id %>"><button class="btn btn-primary">Check</button></a>
                                <a href="notes/delete/<%= notes[i]._id %>"><button
                                        class="btn btn-danger">Delete</button></a></td>
                        </tr>
                        <% } %>

                    </tbody>
                </table>
            </div>

            <div class="col-md-4 mb-5">
                <h2>Add Note</h2>
                <form action="/notes" method="POST">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Title</label>
                        <input type="text" class="form-control" id="title" name="title" placeholder="Enter the title">
                        <small id="title" class="form-text text-muted">Name of your concert</small>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1">Content</label>
                        <input type="text" class="form-control" id="content" name="content" placeholder="Enter content">
                        <small id="emailHelp" class="form-text text-muted">it can be the content</small>
                    </div>

                    <button type="submit" class="btn btn-primary">Submit</button>
                </form>

            </div>
        </div>
        <br>
        <hr>
    </div>

</body>

</html>

File checknote.ejs
This view is to show user one specific note and update it if required
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- load bootsrtap -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
    </div>
    <div class="container">
        <h1>Simple Note using Node Js Express, MongoDb and Bootstrap</h1>
        <hr>
        <a href="/"><button class="btn btn-primary">Home</button></a>
        <hr>
        <div class="row">
            <div class="col-md-8 mb-5">
                <h2>Note you choose..</h2>
                <table class="table table-borderless">
                    <thead>
                        <tr>
                            <td>Title</td>
                            <td>Content</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td><%= notes.title %></td>
                            <td><%= notes.content %></td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div class="col-md-4 mb-5">
                <h2>Update This Note</h2>
                <form action="/notes/update/<%= notes._id %>" method="POST">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Title</label>
                        <input type="text" class="form-control" id="title" name="title" value="<%= notes.title %>">
                        <small id="title" class="form-text text-muted">Name of your concert</small>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1">Content</label>
                        <input type="text" class="form-control" id="content" name="content"
                            value="<%= notes.content %>">
                        <small id="emailHelp" class="form-text text-muted">it can be the content</small>
                    </div>

                    <button type="submit" class="btn btn-primary">Update</button>
                </form>

            </div>
        </div>
        <br>
        <hr>
    </div>

</body>

</html>

Tag : Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner
the user interface of note web app

and I already uploaded the project on github: https://github.com/ZenHuzaini/nodejs-simplenoteapp

I hope it can be useful. Thank you so much for following this tutorial. Don't forget to comment, share and check other articles about Node Js in this blog.

Table Content

title Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 1 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 2 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 3 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 4 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 5 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 6 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 7 Link

Tag :
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner (Part 6)

July 17, 2019 Add Comment

Amazing, after we finished configuring our model and database using Mongodb Atlas, now we are going to create and manage the route used for the middleware of our project.

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
Folder hierarchy

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner (Part 6)

First, we have to make a folder called routes and create a file named note.js inside the folder. Once finished, we can write our codes like below.

const express = require('express'); //load module express
//Express is a module framework for Node that you can use for applications that are based on server/s that will "listen" for any input/connection requests from clients.
const router = express.Router(); //Creating Router() object
//load model
const notes_collection = require('../models/Notes');

//router
//to get all the notes
router.get('/', async (req, res) => {
    try { // using try block catch because we are using asynchronous
        const notes = await notes_collection.find(); //using await to get data collection from model  
        res.json(notes); //to get json object
        // res.render('note_home');
    } catch (error) {
        res.json({ message: error }); //will get
        // res.render('note_home', { notes });
    }
});

//to get one node the notes
router.get('/:id', async (req, res) => {
    try {
        const notes = await notes_collection.find({ _id: req.params.id }); //to get one collection of data regarding id
        res.json(notes);
        // res.render('note_home');
    } catch (error) {
        res.json({ message: error });
        // res.render('note_home', { notes });
    }
});

//to save notes
router.post('/', async (req, res) => {
    const note = new notes_collection({ //create an object containing required key and its value
        title: req.body.title,
        content: req.body.content
    });

    try {
        const saveNote = await note.save(); //save to mongodb
        res.json(saveNote); //show json data after saving
    } catch (error) {
        res.json({ message: error });
    }
});

//to delete
router.get('/:id', async (req, res) => {
    const id = req.params.id;
    try {
        const delNote = await notes_collection.deleteOne({ _id: id });
        res.json(delNote);
    } catch (error) {
        json.res({ message: eror });
    }
});

//to update
router.post('/:id', async (req, res) => {
    try {
        const note = await notes_collection.updateOne(
            { _id: req.params.id },
            {
                $set: {
                    title: req.body.title,
                    content: req.body.content
                }
            }
        );
        res.json(note);
    } catch (error) {
        res.json({ message: error });
    }
});

module.exports = router; //will  export all the routes

Press ctrl + s to save and npm start to run the project.

Now we are ready to test our simple note Using Node js, Express, Mongodb.


Testing the API

To test the APIs of our note project, we need postman. Postman is a Google Chrome app for interacting with HTTP APIs. It presents you with a friendly GUI for constructing requests and reading responses.. Therefore, It is a powerful tool used to test web services. It was developed for sending HTTP requests in a simple and quick way. You can download it in Google chrome – just type Postman.

Now, in Postman choose the type of HTTP method with your needs (to update and save we will use POST, but to get information from database we must use GEET method). Next, define your url with the correct port. After that choose x-www-form-url-encoded and write the key (must be the same like the attributes in database) and give the value of each attributes then click send. If you encounter error please let me know by giving comments : ) .


Just try to do like image below. First you have to make sure that you already start your project. The results will be written in JSON format.

Using Postman for POST method / to Save

This method will be saving new inputs from the user.
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
post method to save data

Using Postman for GET method /notes or /notes/number_id

This method will show all (or one specific) data / information saved in the database.
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
get method to retrieve data

Using Postman for POST method to update /notes/number_id

this method will allow us to do update data 
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
post method to update data

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
the result after updating -> of course we have to check using get method /notes

Use get to delete

the get method is also able to help deleting data. See image below to delete

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
Get method to delete

Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner
Result after deleting -> of course w e have to check using get method /notes

Don’t worry, I know that using postman must be so frustrating and of course, ‘not-user-fiendly enough’. I will also implement our own views here (using HTML).

Final Part : Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner (Part 7)

Table Content

title Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 1 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 2 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 3 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 4 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 5 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 6 Link
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap Part 7 Link

Tag :
Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner, Express, Mongodb and Bootstrap For Beginner, Creating Simple CRUD Using Node js, Express, Mongodb and Bootstrap For Beginner