Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 971 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 971 Bytes

maple-register-api

Installation

  1. download nodejs https://nodejs.org/en

  2. After installing nodejs, run these on the root folder of the project:

npm i
  1. edit the database settings in config/config.json

  2. Set your reCAPTCHA token in config/config.json (or disable it entirely by removing it from controllers/authController.js)

Starting

npm run start

The api server should now run on port 3000

Testing

Testing without a site can be difficult with the reCAPTCHA validation present.

A curl request without token (Edit controllers/authController.js to disable the token):

curl -X POST http://localhost:3000/api/auth/register -H "Content-Type: application/json" -d '{"name":"admin", "password":"password"}'

Additional notes

this form of bcrypt generates a $2b$ encryption, which is is compatible with the $2y$ encryption maplestory bcrypt uses by default. https://www.npmjs.com/package/bcrypt#compatibility-note