This is a "to do" and authentication API built with TypeScript. It allows users to register, login, and authenticate with JWT tokens and generate, edit, delete and get tasks.
- TypeScript
- Node.js
- Express
- JWT
- bcrypt
- Clone the repository:
git clone https://github.com/luiscarlsoto/auth-api-typescript.git - Install dependencies:
npm install. - Set up environment variables:
- Create a
.envfile at the root of the project. - Add the following variables to the
.envfile:
# DB CONFIG DB_HOST = localhost DB_USER = root DB_NAME = todo-api PORT = 3366 # AUTH TOKENS JWT_SECRET = SECRETPASSWORD JWT_EXP_DAYS = 1 - Create a
- Start the server:
npm run start
post - api/auth/singup
// Content-Type: application/json
{
"email": String,
"password": String,
}{
"status": {
"key": "auth.signin.success",
"type": "success"
},
"token": "your-token"
}post - api/auth/signin
// Content-Type: application/json
{
"email": String,
"password": String,
"rememberMe": Boolean
}{
"status": {
"key": "auth.signin.success",
"type": "success"
},
"token": "your-token"
}This project is licensed under the MIT License.