This package provides an authentication API and book events functionality using Express.js, MongoDB, JWT, and bcrypt. It allows users to register, login, and manage book events.
To use this package, you need to have Node.js and npm (Node Package Manager) installed on your system. Clone this repository and follow the steps below:
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and provide the necessary configuration parameters:PORT=3000 DB_URI=mongodb://localhost:27017/auth_express_mongodb JWT_SECRET=mysecretkey
-
Run the server:
npm start
POST /auth/register
: Register a new user.POST /auth/login
: Authenticate a user and receive a JWT token.
POST /events/create
: Create a new book event.GET /events
: Get a list of all book events.GET /events/:id
: Get details of a specific book event.PUT /events/:id
: Update details of a book event.DELETE /events/:id
: Delete a book event.
- Register a user using the
/auth/register
endpoint. - Authenticate a user and receive a JWT token using the
/auth/login
endpoint. - Use the received token for authorization in book events endpoints.
Contributions are welcome! If you find any issues or want to enhance the package, feel free to open a pull request.
This package is licensed under the ISC License.