Quick Start
- How to install
- How to setup a development environment
- How to setup a server
- How to setup a https server
- How to serve static assets
- How to respond text or json or html or file
- How to access request info
- How to match specific request
- How to pass new request info for downstream middleware
- How to filter and manipulate response in upstream middleware
- How to set response headers
- How to set response cookies
- How to set response status
- How to redirect
- How to merge responses
- How to add router
- How to add view-engine
- How to write a farrow hooks
#
How to install#
How to setup a development environmentadd scripts
to your package.json
and then:
npm run dev
for developingnpm run build
for bundling the source codenpm run start
for runing the output code of bundler
farrow
assumes that your source code is in src
folder, and the output code is in dist
folder.
You can use farrow.config.js
to change the default configuration, see the documentation for more detail.
#
How to setup a server#
How to setup a https server#
How to serve static assets#
How to respond text or json or html or file#
How to access request info#
How to match specific requestClick Router-Url-Schema to read more
#
How to pass new request info for downstream middleware#
How to filter and manipulate response in upstream middleware#
How to set response headers#
How to set response cookies#
How to set response status#
How to redirect#
How to merge responses#
How to add routerRouter()
has the same methods like Http()
except http.listen(...)
and http.server()
#
How to add view-engineFarrow
provide an official server-side rendering library based on React
, but you can implement your own via Response.html(...)
or Response.stream(...)
.