Examples

Product resource#

This generator workflow comes from the upstream README. Run it in a project with its database and authentication configured:

BASH
ctg make:resource Product name:string price:decimal stock:integer active:boolean description:text?
ctg migrate
ctg dev

Inspect the generated routes with ctg route:list. Resources are private by default; read the access rules. This recipe is based on framework source and has not been tested as an integration example by this website.

Go handler#

Excerpt from the upstream example/main.go:

GO
app.Get("/", func(ctx *core.Context) error {
    return ctx.JSON(core.Map{"framework": "CopyTyGo", "version": "1.0.0", "status": "running"})
}).Name("home")

The version value in this excerpt is the upstream example payload, not the framework version. Read the complete application for imports, configuration, and the server lifecycle.

Frontend and background jobs#

All examples refer to the v5.0.0 source. End-to-end application testing requires the appropriate Go and Node versions and a configured database.

Search documentation

Type to search the documentation.