API Design / Installation & setup
CLI tools & setup
Prepare your workspace, run a small example and check the result before starting the course.
A terminal is where you type commands. A runtime or compiler runs your code; a package manager installs project dependencies. Follow the tools and command surfaces named in this course’s guide.
Already set up? Continue to What an API Is →
BEFORE THE FIRST CODING TASK
Your computer, ready to learn.
A tiny local HTTP API
Create a new practice folder in your editor and open its integrated terminal there. Use a separate folder from personal or production projects. Install supported Node LTS. Use a new folder and save server.mjs below. This fixture uses only the built-in HTTP library, has no credentials and binds to your local computer.
Already configured? Run the verification steps and continue. Use the command surface labelled beside each snippet, such as your terminal or SQL console.
Files to create
Save these files in the practice folder described above before running its file commands.
import http from "node:http";
const port = 8765;
const server = http.createServer((request, response) => {
response.writeHead(200, { "content-type": "application/json" });
response.end(JSON.stringify({ ready: true, message: "My workspace is ready" }));
});
server.listen(port, "127.0.0.1", () => console.log(`http://127.0.0.1:${port}`));
- 1
Verify Node, then start this new local fixture.
Windows · Terminalnode --version node server.mjsWhat you should see: The process reports the local URL. Open it in your browser to see a JSON ready value of true.
Something didn’t work?
Check the saved filename and current directory. If the port is occupied, change the port constant in this fixture.
- 2
Change the returned message and restart the process. Read its response again.
What you should see: The response changes after the new source actually runs.
Something didn’t work?
Editing a file does not automatically restart this plain Node process. Stop it with Ctrl+C before restarting.
Check it yourself
Explain the local client, request, handler, status and JSON body. This starter does not implement authentication, persistence or production serving.
This is a self-check; it does not mark a lesson or course complete.
Official setup guides & version requirements
My workspace notes
Notes stay in this browser. They are not uploaded or assessed.