Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wilsonsilva/fiber-htmx
Go Fiber + HTMX PoC
https://github.com/wilsonsilva/fiber-htmx
flowbite go go-fiber golang hot-reloading htmx tailwind tailwind-css
Last synced: about 2 months ago
JSON representation
Go Fiber + HTMX PoC
- Host: GitHub
- URL: https://github.com/wilsonsilva/fiber-htmx
- Owner: wilsonsilva
- License: mit
- Created: 2023-09-01T10:58:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T09:01:35.000Z (about 1 year ago)
- Last Synced: 2024-06-21T18:10:35.312Z (6 months ago)
- Topics: flowbite, go, go-fiber, golang, hot-reloading, htmx, tailwind, tailwind-css
- Language: CSS
- Homepage:
- Size: 216 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# HTMX + Go Fiber
A proof of concept HTMX app with a Go Fiber backend. Displays a list of tickers from polygon.io
and a list of news related to the ticker.
## Requirements
- Go `1.21+`
- An API key from [Polygon.io](https://polygon.io/dashboard/api-keys)## Installation
Copy `.env.example` to `.env` and add your Polygon.io API key.
Fetch the dependencies
```sh
go get
```## Development
Run the following commands to build the Tailwind CSS classes:
```sh
npm install
npm run dev
```Or if you prefer to use [bun](https://bun.sh/):
```sh
bun install
bun run dev
```There are two options to start the web server:
- without hot reloading
- with hot reloading### Without hot reloading
```sh
go run .
```### With hot reloading
Go Fiber does not have a hot reloading feature. Install [`air`](https://github.com/cosmtrek/air#installation) to run
the app with hot reloading.```sh
air
``````
__ _ ___
/ /\ | | | |_)
/_/--\ |_| |_| \_ v1.49.0, built with Go go1.21.4watching .
watching bin
!exclude node_modules
watching public
watching src
!exclude tmp
watching views
building...
running...┌───────────────────────────────────────────────────┐
│ Fiber v2.51.0 │
│ http://127.0.0.1:3000 │
│ (bound on host 0.0.0.0 and port 3000) │
│ │
│ Handlers ............. 7 Processes ........... 1 │
│ Prefork ....... Disabled PID ............. 76782 │
└───────────────────────────────────────────────────┘
```Then open the browser to http://localhost:3000. You should be able to search for a stock's ticker
upon clicking on a ticker, you should see a list of news related to the ticker.