Giter Site home page Giter Site logo

akashyap2013 / crud_application_node Goto Github PK

View Code? Open in Web Editor NEW
262.0 262.0 268.0 33 KB

In this project, we are going to create node CRUD application with express and mongodb.

License: Apache License 2.0

CSS 20.84% JavaScript 37.05% HTML 42.12%

crud_application_node's Introduction

About MySelf

  • ๐Ÿ‘‹ Hi, Iโ€™m @akashyap2013 from india.
  • ๐Ÿ‘€ Iโ€™m a Youtuber. I have a youtube channle @DailyTuition
  • ๐ŸŒฑ I love programming so i decided to make videos on it
  • ๐Ÿ“ซ You can reach me at @akki.2013 on Instagram.

crud_application_node's People

Contributors

akashyap2013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

crud_application_node's Issues

Form action issue for add user

On "_form.ejs" file --

On "controller.js" file --
// save user in the database
user.save(user).then(data => {
res.send(data)
res.redirect('/add_user');
}).catch(err => {
res.status(500).send({
message: err.message || "Some error occurred while creating a create operation"
});
});
}

It's showing the raw .json format after submitting the new user data.
Capture
Capture-1

Form validation

How to perform form validation on,

<div class="form-group">
    <label for="min_n" class="text-light">Minimum Number</label>
    <input type="number" min="1" onkeyup="MaximumNValidate()" name="min_n" value="" placeholder="123" required>
</div>
<div class="form-group">
    <label for="max_n" class="text-light">Maximum Number</label>
    <input type="number" min="1" onkeyup="MaximumNValidate()" name="max_n" value="" placeholder="321" required>
</div>
function MinimumNValidate(){
        var min = parseInt(document.getElementsByName("min_n").value);
        var max = parseInt(document.getElementsByName("max_n").value);
        if(min > max) {
            alert("Minimum value must be lesser than maximum value. " + min + " > " + max );
        } 
    }    

    function MaximumNValidate(){
        var min = parseInt(document.getElementsByName("min_n").value);
        var max = parseInt(document.getElementsByName("max_n").value);
        if(max<min) {
            alert("Maximum value must be greater than minimum value."  + min + " > " + max );
        } 
    }

It works on normal html but it's not working on nodejs

"message":"connect ECONNREFUSED ::1:3000"

started server after installing all dependencies and also created .env file.
these are the variables with their values:

PORT=5000
MONGO_URI=mongodb://127.0.0.1/crudnodeapp

I just got this error on my browser screen
{"message":"connect ECONNREFUSED ::1:3000","name":"Error","stack":"Error: connect ECONNREFUSED ::1:3000\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)","config":{"url":"http://localhost:3000/api/users","method":"get","headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/0.21.0"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNREFUSED"}

i just tried to go on another manually by typing their urls got from routes file
only one route work for me @method GET /add-user
another both routes @method GET / and @method GET /update-user throw same error mentioned above...
one more thing i want to add is that database is all good. I created the user using above working route /add-user and then checked the collection it was successfully added to the database. Plz help me

Issues

Hello! I 'm sorry for my question.
I don't understand what am I can writing in file config.env.
I written
PORT = 8080
MONGO URI = // localhost: 8080/connection
and I have error (

search name

How can I add search by name functionality on frontend?

api-user

image
****can not able to add new user

nodemon crashed

nodemon crashed while connecting with local `mongoDB.

[nodemon] app crashed - waiting for file changes before starting...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.