Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Temp fix for auth link portal Mongo-Vercel issues

Notifications You must be signed in to change notification settings

pesu-dev/auth-link-portal-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMPORTANT

This API is now offline. A fix for the auth-link-portal has been implemented, therefore this API is no longer needed.

PESU API Server

A Node.js Express server with MongoDB for managing student records and link records.

Features

  • checkPrnExists: Check if a PRN exists in the link records
  • studentRecordCreateOrUpdate: Create or update student records
  • linkRecordCreate: Create link records between users and PRNs

API Endpoints

All endpoints require authentication with Bearer banana token in the Authorization header.

GET /api/check-prn/:prn

Check if a PRN exists in the link records.

Response:

{
  "success": true,
  "data": {
    "prn": "PES1UG20CS123",
    "exists": true
  }
}

POST /api/student

Create or update a student record.

Request Body:

{
  "prn": "PES1UG20CS123",
  "branch": {
    "full": "Computer Science and Engineering",
    "short": "CSE"
  },
  "year": "2020",
  "campus": {
    "code": 1,
    "short": "RR"
  }
}

POST /api/link

Create a link record between a user and PRN.

Request Body:

{
  "userId": "user123",
  "prn": "PES1UG20CS123"
}

Setup

  1. Install dependencies:

    yarn install
  2. Update the MongoDB connection string in .env file

  3. Start the server:

    yarn dev

The server will run on port 3000 by default.

Authentication

All API endpoints require the following header:

Authorization: Bearer banana

About

Temp fix for auth link portal Mongo-Vercel issues

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published