Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a complete web and api server #3

Merged
merged 13 commits into from
Dec 5, 2024
Merged

Create a complete web and api server #3

merged 13 commits into from
Dec 5, 2024

Conversation

malpercio-dev
Copy link
Member

@malpercio-dev malpercio-dev commented Dec 2, 2024

In order to lay a framework in which we can continue to build out the atBB AppView, this PR adds a basic HTML page, api route, and health checking.

  • axum, built on top of hyper, is used to provide a lightweight web framework
  • tera provides a templating engine to render HTML server-side
  • tower_http provides middleware for serving static content from a directory
  • health to assist in periodic health checking
  • htmx is included in the client bundle to provide later interactivity

The basic structure of the repository is now as follows:

-- src
   |-- api               # module for the api
   |   |-- routes        # axum routes
   |   |   |-- healthz   # mounted at /healthz, provides checks for container orchestration
   |   |   |-- v1        # mounted at /v1
   |-- models            # module for shared internal models
   |-- resources         # module for shared resources such as databases, external services
   |-- web               # module for the webapp
   |   |-- pages         # axum routes for server rendering pages, mounted at /
   |   |-- static        # static content, mounted at /static
   |   |-- templates     # tera templates for use in server rendering HMTL

src/models/forum.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/server.rs Outdated Show resolved Hide resolved
@BrokenR3C0RD BrokenR3C0RD merged commit 07c0735 into main Dec 5, 2024
1 check passed
@malpercio-dev malpercio-dev deleted the web-http branch December 5, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants