A smart travel backend built with Node.js + Express that combines geolocation, weather forecasts, and facility information to help users plan trips based on their selected city and state.
Click the buttons below to see example responses from each route.
/location-info
, trip preferences, and static view.Method | Endpoint | Protected? | Description | Body/Headers |
---|---|---|---|---|
POST | /user/register | No | Register a new user |
{ "username": "yourname", "email": "your@email.com", "password": "yourpassword" } |
POST | /user/login | No | Login and receive JWT tokens |
{ "email": "your@email.com", "password": "yourpassword" } |
GET | /user/profile | Yes | Get the authenticated user's profile |
Headers:
Authorization: Bearer <access_token> |
POST | /user/logout | Yes | Logout user (client should delete token) |
Headers:
Authorization: Bearer <access_token> |
POST | /user/refresh-token | No | Get a new access token using a refresh token |
{ "refreshToken": "<refresh_token>" } |
Note: All protected routes require a valid JWT access token in the Authorization
header.