✅ Mac Terminal Checklist for AI Gateway
1. Open a new terminal window
- Press
Command + Nin 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 + Nagain. - Navigate to the same folder (optional, just for context):
cd /Users/shawnhonnick/ai-gateway
4. Test the POST endpoint
- Run this
curlcommand 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
curlcommand 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
- Always run server in one terminal.
- Always run tests/
curlcommands in a separate terminal. - Use
CTRL + Cin the server terminal to stop it safely. - Avoid running Node commands directly in the macOS Terminal prompt (like
dquote>errors) — always make sure the.jsfile exists and is in your current directory.
Leave a Reply