Skip to content

Gleam language support #100

Description

@zedtux

Here is an example of Gleam code:

import app/models/post
import app/pages/home
import app/pages/root.{root}
import framework/renderers
import framework/types/routes.{type RouteParams}
import wisp.{type Request, type Response}

// This action respond only with HTML because a RootRoute can only render HTML.
// See app/routes.gleam.
pub fn index(_request: Request, _params: RouteParams) -> Response {
  root(home.build(post.all()))
  |> renderers.html
  |> wisp.html_response(200)
}
  • app/models/post is from my application, so I have an <project_root>/src/app/models/ folder with a post.gleam file.
  • framework/renderers is the same as app, I have a <project_root>/src/framework/ folder with a renderers.gleam file
  • wisp is an external library installed at the path <project_root>/build/packages/wisp/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions