Skip to content

Instantly share code, notes, and snippets.

View bhongy's full-sized avatar

Thanik Bhongbhibhat bhongy

View GitHub Profile
@miclle
miclle / timestamp.go
Created July 9, 2020 02:55
golang timestamp type
package timestamp
import (
"database/sql/driver"
"fmt"
"strings"
"time"
"github.com/araddon/dateparse"
"github.com/globalsign/mgo/bson"
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active October 14, 2024 00:05
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.