Skip to content

prettlee/pso7chatapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS390 Chat API - Pair Programming Assignment

Build a simple REST API for a chat application with your partner!

Setup

npm install

Your Task (Work Together!)

Complete the TODOs in server.js to implement:

  • POST /users - Register a user
  • POST /messages - Send a message
  • GET /messages - Get all messages

Run Your Server

npm start

Server starts on http://localhost:3000

Test Your Implementation

Option 1: Same Computer

  1. Open test-api.html in multiple browser windows/tabs
  2. Join as different users in each window
  3. Chat between windows to test your API!

Option 2: Remote Partners (using ngrok)

# One partner runs:
npx ngrok http 3000

# Share the ngrok URL with your partner
# Both open test-api.html and update the API URL

Option 3: curl

curl -X POST http://localhost:3000/users \
  -H "Content-Type: application/json" \
  -d '{"name":"Alice"}'

Good Luck!

Have fun building your chat API! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published