Mac-specific, crash-proof checklist for getting your AI Gateway running and tested safely


✅ Mac Terminal Checklist for AI Gateway

1. Open a new terminal window

  • Press Command + N in Terminal to open a fresh window.
  • Navigate to your project folder:
cd /Users/shawnhonnick/ai-gateway

2. Start the Node server

  • Run:
node index.js
  • You should see:
AI Gateway running at http://localhost:3000

⚠️ Leave this terminal window open and do not type anything else here. This is your “server window.”


3. Open a second terminal window

  • Press Command + N again.
  • Navigate to the same folder (optional, just for context):
cd /Users/shawnhonnick/ai-gateway

4. Test the POST endpoint

  • Run this curl command in the second terminal:
curl -X POST http://localhost:3000/ask -H "Content-Type: application/json" -d '{"question":"Hello, AI!"}'
  • Expected output:
{"answer":"You asked: \"Hello, AI!\" (AI engine not yet connected)"}

✅ If you see this, the AI Gateway is running correctly.


5. Check for port conflicts

  • If the curl command fails, make sure nothing else is using port 3000:
lsof -i :3000
  • If any process shows up (other than your node index.js), kill it:
kill -9 <PID>

6. Tips to avoid Terminal crashes

  1. Always run server in one terminal.
  2. Always run tests/curl commands in a separate terminal.
  3. Use CTRL + C in the server terminal to stop it safely.
  4. Avoid running Node commands directly in the macOS Terminal prompt (like dquote> errors) — always make sure the .js file exists and is in your current directory.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *