razzle-examples-with-koa v3.0.0
Using Razzle and Koa
How to use
- Download the example or clone the whole project:
curl https://codeload.github.com/jaredpalmer/razzle/tar.gz/master | tar -xz --strip=2 razzle-master/examples/with-koa
cd with-koa
- Install it and run:
yarn install
yarn start
Idea behind the example
This is an example of how to use Koa, a popular web application framework, with a Razzle project, as an alternative to the default Express server.js
setup.
Being minimalistic in its philosophy, Koa doesn't include most required dependencies to mimic its Express counterpart, so this example relies on some additional packages.
koa-static
(docs)
Static file serving middleware. Used to serve resources under process.env.RAZZLE_PUBLIC_DIR
.
koa-router
(docs)
Express-styling router middleware for Koa. Will direct HTTP GET
requests to your React client.
koa-helmet
(docs)
Provides important security headers to make your app more secure by default. Among other things, it prevents the X-Powered-By
header from being sent to requesting clients.
For additional information, refer to Koa offical documentation.
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago