UNPKG

winterspec

Version:

Write Winter-CG compatible routes with filesystem routing and tons of features

8 lines (7 loc) 274 B
export const addFetchListener = (winterSpec) => { addEventListener("fetch", async (event) => { // TODO: find a better way to cast this const fetchEvent = event; fetchEvent.respondWith(await winterSpec.makeRequest(fetchEvent.request)); }); };