FoalTS is a high-level Node.JS to quickly build web apps in TypeScript:
It is natively written in TypeScript and aims to be used in this language with all its features.
It is designed to fastly bootstrap and develop an application. Authentication, REST API, developing tools, you don't need to re-invent the wheel anymore while programming with Node.JS.
Its architecture can support growing app especially when it deals with structuring the code.
Let's get started!
To start a project you need to set up your development environment.
First install Node.Js and npm if they are not already installed on your host.
Then install the FoalTS generator.
npm install -g yo generator-foal
You are now ready to create your first foal project.
Open a terminal and then run the following command:
yo foal my-app
A new folder
my-app should appear in your current directory with the dependencies installed. The foal generator automatically created the basic structure of your app with a set of developpment tools to easily get started.
Go the project directory and start the server.
cd my-appnpm run develop
Open you browser on
http://localhost:3000 and find our welcoming message!
npm run developstarts the development server. It watches at your files and automatically compiles and reloads your code. You don’t need to restart the server each time you make code changes. Note that it is only intended to be used in development, do not use it on production.
Port 3000 already in use?
You can modify in
config/settings.jswhich port the application is using.
What's the next move?
Read the official guide to learn more on
Let’s take a look at what
yo foal my-app created:
src contains all the code of your app.
All files in the parent directory which don't belong to
src are configuration files to build and lint your app.