How to run ?
In the project directory, Add .env file first.
env file contain this value:
JWT_SECRET = your jwt secret
TOKEN_EXPIRE = your jwt token lifetime
DB_HOST = your database host
PORT = your database port
DB_USER = your database username
DB_PASSWORD = your database password
DB_NAME = your database name
API Reference:
Api End point | Description |
POST /api/auth/register | user registration |
POST /api/auth/login | user login and get token |
POST /api/customer/register | customer registration (must register for user first) |
POST /api/auth/register ->
{
"username":"your username",
"password":"your password",
"passwordVerify":"verify password"
}
POST /api/auth/login ->
{
"username":"your username",
"password":"your password"
}
POST /api/customer/register ->
{
"customer_name":"iqbal"
}
*note: for customer endpoint, you need to logged in first and add jwt token on Authorization in header request