Skip to content

Instantly share code, notes, and snippets.

View nathanchase's full-sized avatar
👨‍💻
Developing the future

Nathan Chase nathanchase

👨‍💻
Developing the future
View GitHub Profile
@nathanchase
nathanchase / [...].ts
Last active March 7, 2024 02:34
Nuxt 3 Server API catch-all w/ caching, retries, and request/response logging (with total elapsed time)
// Here's my current implementation of a Nuxt 3 server API catch-all with caching, retries, and request/response logging with total elapsed time:
// Place in: /server/api/[...].ts
import LRU from 'lru-cache';
import { getCookie } from 'h3';
const config = useRuntimeConfig();
const cache = new LRU({
max: 100,

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream