Skip to content

πŸ““ πŸ“” Study of Services Restful with Hapi.js and related topics

License

Notifications You must be signed in to change notification settings

stivenson/Hapi-Study

Repository files navigation

Nodejs-Study

license github-issues stars forks

Exercises for personal study of Nodejs, frameworks and related topics

πŸŒ„ Getting Started

πŸŒ… Description of folders

  • 🚲 hapi-basic-example: Hapi.js
  • 🚴 hapi-rest-services: Hapi.js Basic Restful Services
  • πŸš• hapi-rest-services-jwt: Hapi.js Basic Restful Services and JWT authentication
  • 🚜 hapi-rest-services-jwt-bcrypt: Hapi.js Basic Restful Services, JWT authentication and Bcrypt
  • πŸš› hapi-rest-services-jwt-bcrypt-Middle: Hapi.js Basic Restf., JWT, Bcrypt, Middle., and Authorization (roles).
  • 🚚 hapi-rest-class-es6: Hapi, Restful, JWT, Bcrypt, Middle. Autho., ES6 Classes. 🌠
  • πŸš™ hapi-rest-mysql (See function testConnectTableUser): Hapi, Restful, JWT, Bcrypt, Middle. Autho., ES6 Classes, Mysql. 🌠

πŸŒ‡ In each folder, run:

  • npm install or yarn install

  • npm start or yarn start

Additional for hapi-rest-mysql project:

  1. Install mysql version 5.6.x and create a database called hapimysql.

  2. Change connection data to mysql in /hapi-rest-mysql/api/config.js with your connection data.

  3. After, run the following sql into hapimysql database:

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `names` varchar(100) NOT NULL,
  `surnames` varchar(100) NOT NULL,
  `number_identification` varchar(25) NOT NULL,
  `role` varchar(30) NOT NULL,
  `email` varchar(150) NOT NULL,
  `password` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

πŸŒƒ Learning

  1. Hapi.js

  2. JWT (Json Web Tokens)

  3. hapi-auth-jwt2

  4. hapi-authorization

Scripts

  • npm run start : node app.js
  • npm run test : NODE_ENV='test' ./node_modules/lab/bin/lab -c
  • npm run startpro : NODE_ENV=pro node app.js
  • npm run readme : node ./node_modules/.bin/node-readme

Dependencies

Package Version Dev
bcrypt ^1.0.2 βœ–
code ^4.0.0 βœ–
hapi ^16.1.0 βœ–
hapi-auth-jwt2 ^7.2.4 βœ–
hapi-authorization ^3.0.2 βœ–
jsonwebtoken ^7.3.0 βœ–
lab ^12.1.0 βœ–
node-readme ^0.1.9 βœ”

Contributing

Contributions welcome; Please submit all pull requests the against master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests. Thanks!

Author

Stivenson Rincon

License

About

πŸ““ πŸ“” Study of Services Restful with Hapi.js and related topics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published