Git Product home page Git Product logo

rest-crud's Introduction

This is an example of RESTful CRUD in Node.js n mySQL.

Installation, and tutorial here : http://teknosains.com/i/restful-crud-example-with-nodejs-and-mysql

Live DEMO: http://teknosains.com/i/simple-crud-nodejs-mysql

Installation

*for newbies : Clone or download zip to your machine then hit this :

cd rest-crud

then

npm install

Configuration (database)

server.js

    host: 'localhost',
    user: 'root',
    password : 'root',
    port : 3306, //port mysql
    database:'test'	

You're gonna need to create a DB named 'test' or whatever you name it, import t_user.sql

Open your Browser

And type: localhost:3000/api/user

rest-crud's People

Contributors

gpedro avatar teknosains 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rest-crud's Issues

Internet dependency

Hi, I'm quite new in using express.

I try to run this CRUD without internet. And it always show "Cannot Connect" when accessing database.
Is there any method I can do/need to install to make it able to run in my laptop without Internet?
Thanks!

Doesn’t work

After successful installation and starting of the server, it says "Welcome" but when I go to any URL (e.g. "localhost:3000/user") it shows an error page: "Cannot GET /user". The database was created and seeded using the t_user.sql file.

mysql> select * from t_user;
+---------+------------+--------------------+--------------------+
| user_id | name       | email              | password           |
+---------+------------+--------------------+--------------------+
|       1 | Mas Banyar | [email protected]   | 23235645yghgf      |
|       2 | Mas Mapmup | [email protected]   | dncskdcndscsdcdsc  |
|       4 | Boronong   | [email protected] | 032bcsjdncsdjc3223 |
|       5 | Nadya Ek   | [email protected]    | bonbon032932       |
+---------+------------+--------------------+--------------------+
4 rows in set (0.00 sec)

Are there any additional instructions that are required to make it work despite not being mentioned in the project readme?

Mysql connect ECONNREFUSED

The port seems to cause an error ECONNREFUSED from mysqld when the system uses a random port.

Adding the below fixes issue:
port : '/var/run/mysql/mysql.sock' // or whereever your systems socket is stored

Cannot GET /user when using localhost:3000/user

Hi

when i run node server.js file
localhost:3000 - redirected to welcome page
when i use
localhost:3000/user - it getting error in localhost/user

i have connected db and table is correct and contains data.
can u please tell what is the exception here occuring.

"No" user column is not in sync with the database

Hey,

I think line 24 in user.js should be <td><%=data[i].user_id%></td>, because otherwise if you delete a user from the middle of the table, it won't be in sync with the database IDs anymore.

Cheers.

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.