Skip to content

sonhyrd/widget-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HR Token API

A simple Express.js API server that generates JWT tokens for HR integration.

Getting Started

Installation

  1. Install dependencies:
npm install

Running the Server

Development Mode (with auto-restart)

npm run dev

Production Mode

npm start

The server will start on port 3000 by default (or the port specified in the PORT environment variable).

API Endpoints

POST /hr-token

Generates a JWT token for HR integration.

Request Body:

{
  "userId": "string (required)",
  "email": "string (required)", 
  "firstName": "string (optional)",
  "lastName": "string (optional)"
}

Response:

{
  "token": "jwt_token_string",
  "expiresIn": 5184000
}

Example Usage:

curl -X POST http://localhost:3000/hr-token \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "12345",
    "email": "user@example.com",
    "firstName": "John",
    "lastName": "Doe"
  }'

GET /health

Health check endpoint that returns server status.

Response:

{
  "status": "OK",
  "timestamp": "2023-01-01T00:00:00.000Z"
}

Environment Variables

  • PORT: Server port (default: 3000)

Token Details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors