Your first page

With your project created and the server running, let’s edit its initial page.

If you have not created a project yet, follow the quick start first.

Your first page

Open the file:

text
pages/index.gox

Its initial content is:

gox
module index

import "github.com/gox-lang/gox"

func GET(ctx *gox.Context) gox.Page {

	return <h1>Hello Gox</h1>
}

Replace its content with:

gox
module index

import "github.com/gox-lang/gox"

func GET(ctx *gox.Context) gox.Page {

	return <main>
		<h1>Mi primera aplicación GOX</h1>
		<p>La aplicación está funcionando.</p>
	</main>
}

When you save the file, GOX will detect the changes and recompile the page. When you refresh the browser, you will see the new version.

Next step

Now that you have edited your first page, explore the project structure to learn what each directory is for.

Project structure