Skip to content

📱 This is a template for creating next.js projects using KoaJs and offline features

License

Notifications You must be signed in to change notification settings

clem109/nextjs-koa-styledcomponents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔥 Next.js, Koa, PWA, Styled Components Template

Do the following and you are good to go:

# be a cool kid and install with yarn
yarn

# playing around?
yarn dev

# wanna build and start? I got you.
yarn go

This project uses next-offline for the service worker stuff to cache assets. Styled-components are setup out of the box, otherwise just delete the .babelrc and anything you see related to it.

Also, this shows usage with the apimaze API, specifically for getting Batman info. Notice links in index.js are prefetched for offline usage ✨

# healthcheck route added for those who need it for prod systems.

# GET
BASE_URL/healthcheck

Common issues I had

  • The order of the Koa scripts is important when serving static files.
  • If you're using the server.js file for serving your site running next start will ignore that - this took me a while to figure out.
  • If you want to use nextjs to add APIs, make sure that your Koa ctx.respond = true otherwise you won't get a response.

Inspiration or useful links

Releases

No releases published

Packages

No packages published