Quickstart
Create a small HTTP app, send it a request, and run its tests. GoForj is available in public beta.
Prerequisites
You need Go 1.26 or newer and a shell. The CLI and Web API components run directly on your machine.
Install GoForj
go install github.com/goforj/goforj/cmd/forj@latest
forj --versionIf your shell reports forj: command not found, add Go's binary directory to PATH and run forj --version again.
export PATH="$(go env GOPATH)/bin:$PATH"Generate the Project
forj newName the Project photodrop and accept the suggested module path. On the Components screen, press c, then select Web API. CLI stays selected. Choose Skip at the Atlas prompt and use photodrop as the destination. Accept the other defaults.
When the wizard reports a successful render, enter the directory containing .goforj.yml.
cd photodropStart the App
Port 3000
If port 3000 is busy, set API_HTTP_PORT in .env to a free port. Use that port in the requests below and in the next guide.
From the Project root, start the development loop:
forj devThe first build downloads Go modules before compiling the app. Wait for Dev ready. The line below it gives your app's URL, which looks like this with the default port.
✔ Dev ready
→ App: http://localhost:3000Leave forj dev running.
Make the First Request
In a second terminal, run this from the Project root.
curl http://localhost:3000/-/health
# {"status":"ok"}List the Routes
From the same terminal, list the routes registered by the default App.
forj route:listLook for /-/health in the route table.
The forj shorthand runs App commands from your current source.
| From source | From a built binary |
|---|---|
forj route:list | ./bin/app route:list |
forj admin route:list | ./bin/admin route:list |
Run the First Test
In the same terminal, run the generated tests.
go test ./...A successful run reports ok or [no test files] for each package.
Next Steps
Keep forj dev running and add your first route in this Project. The guide shows where the controller, service, and test go and how the app wires them together.