Getting Started
Overview
Welcome to the Farrow documentation!
Farrow(Functional and arrow, pronounced /ˈferō/
) is a Type-Friendly Web Framework for Node.js. It consists of three major parts:
- Type-Friendly HTTP Server.
- Type-Friendly and End-to-end code generational RPC Server.
- Full stack famework for a web project.
If you have questions about anything related to Farrow, you're always welcome to ask our community on GitHub Discussions.
System Requirements
- Node.js 14.18.1 or later
- TypeScript 4.3.0 or higher(Can be installed with scaffolding if farrow is not introduced in an existing project)
- MacOS, Windows (including WSL), and Linux are supported
Setup
Init project by creating a empty Node.js project.
- npm
- Yarn
mkdir farrow-project
cd ./farrow-project
npm init -y
mkdir farrow-project
cd ./farrow-project
yarn init -y
Install Farrow libraries
- npm
- Yarn
npm install farrow-http
yarn add farrow-http
Create src/index.ts
as entry and add the following content
import { Http, Response } from "farrow-http";
const http = Http();
http.use(() => {
return Response.text("Hello Farrow");
});
http.listen(3000, () => {
console.log("server started at http://localhost:3000");
});
Install development tools
- npm
- Yarn
npm install --dev farrow typescript
yarn add -D farrow typescript
Add scripts
in package.json
{
"scripts": {
"dev": "farrow dev",
"build": "farrow build",
"start": "farrow start"
}
}
Start server with:
- npm
- Yarn
npm run dev
yarn run dev
Open your browser and navigate to http://localhost:3000/.
Setup with Template
We also recommend creating a new Farrow app using create-farrow-app
, which sets up everything automatically for you. To create a project, run:
- npm
- Yarn
npm init farrow-app farrow-project
yarn create farrow-app farrow-project
Select a template.
? Select a template:
❯ farrow-only
farrow-vite-react
farrow-next-react
After the initialization is complete, follow the instructions to start the development server.
- npm
- Yarn
cd farrow-project
npm install
npm run dev
cd farrow-project
yarn
yarn dev
Open Farrow Playground and connect to http://localhost:3000/api/todo.
info
For more information on how to use create-farrow-app
, you can review the create-farrow-app
documentation.