Giter Site home page Giter Site logo

yug95 / node-mysql Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 47.0 231 KB

Node with mysql boilerplate

License: MIT License

JavaScript 2.51% HTML 97.49%
ajv artillery bcrypt-encryption bcrypt-nodejs express jwt-authentication jwt-middleware jwt-token mvc-framework mysql mysql-database node-module node-mysql nodejs nodemailer nodemon pm2 swagger swagger2 xampp

node-mysql's People

Contributors

masteru2017 avatar yug95 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

Watchers

 avatar  avatar  avatar  avatar  avatar

node-mysql's Issues

Issue with table user not found

I have setup this sample. not sure if need to create db and table in mysql separately ? I am getting below error:

{
"code": "ER_NO_SUCH_TABLE",
"errno": 1146,
"sqlMessage": "Table 'sampledb.user' doesn't exist",
"sqlState": "42S02",
"index": 0,
"sql": "SELECT * FROM user WHERE username ='test'"
}

is there any db script that needs to be executed? DB i create manually, but not sure about table details.

Getting error when I try signup

Below is the error

\app\models\authentic.model.
js:42
return next(err);
^

ReferenceError: next is not defined
at \app\models\authentic
.model.js:42:21
at \node_modules\bcrypt
bcrypt.js:140:13
at process._tickCallback (internal/process/next_tick.js:61:11)
[nodemon] app crashed - waiting for file changes bef

error occurred when running npm install

[email protected] install /Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/fsevents
node install

node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" is installed via remote

[email protected] install /Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v67 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v67 ABI) (falling back to source compile with node-gyp)
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
sed: ./Release/.deps/Release/obj.target/bcrypt_lib/src/blowfish.o.d.raw: No such file or directory
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
rm: ./Release/.deps/Release/obj.target/bcrypt_lib/src/blowfish.o.d.raw: No such file or directory
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/11.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt
gyp ERR! node -v v11.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/11.10.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:984:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 18.6.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/11.10.0/bin/node" "/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt
node-pre-gyp ERR! node -v v11.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/11.10.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding' (1)
touch: ./Release/.deps/Release/obj.target/bcrypt_lib/src/bcrypt.o.d.raw: No such file or directory
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/11.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /Users/admin/projects/react/bambiniinternational/backend/node-mysql/node_modules/bcrypt
gyp ERR! node -v v11.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2019-06-12T02_10_34_076Z-debug.log

Issue with JWT Login

Everytime I try to login in Postman it returns this JSON:

{
    "error": {
        "statusCode": 422,
        "name": "ValidationError",
        "message": "Unprocessable Entity",
        "details": {
            "context": "authentic",
            "codes": [
                "USERNAME_REQUIRED"
            ],
            "messages": [
                {
                    "USERNAME_REQUIRED": "should have required property 'username'"
                }
            ]
        }
    }
}

I'm using MySQL database that I created manually like this:

CREATE TABLE `User` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(255) DEFAULT NULL,
  `password` int(11) DEFAULT NULL,
  `CreatedDate` datetime DEFAULT NULL,
  `UpdatedDate` datetime DEFAULT NULL,
  `UpdatedBy` int(11) DEFAULT NULL,
  `IsEnabled` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

Here is a printscreen of how I am using it on Postman:
captura de ecra 2018-08-02 as 11 30 28

Can someone help me out please?

Crashes on macOS

Installed all dependencies.
when I am going to run it, it is crashed.

server connected to port 9890

/Volumes/Work/node-mysql/node_modules/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^
TypeError: Cannot read property 'release' of undefined

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.