src/: Contains hooks that apply to every service.src/app.js: Configures our Feathers application.src/index.js: The entry file that runs the application.src/service: Contains our application services.src/middleware: Contains Express middlewares.src/hooks: Contains the application custom hooks.src: Contains the server code for Feathers.js applications.public: Contains the static files that can be served to the client.node_modules: A folder to store the list of installed packages required to run the application. ![]() config: Contains the configurations files for the application.Folder structureįor this tutorial, we'll look at once we look at the following: Now let's look at the folder structure generated by running the above command. Once the selections are completed, the command will generate an express-like project structure. Selected Sequelize as the ORM for the application.Selected user as the name for our entity.Choose a username and password authentication strategy.Selected src the location for the project boilerplates.Specified the name for the application ( movie-rental).Selected Javascript as the preferred programming language.In the above screenshot, we made the following selections: For the demonstration in this tutorial, your selection should look like the screenshot as shown below: Expected result ![]() The above command will prompt you to select the configuration for your application. Then, generate a new API application with the command below: feathers generate app Create the app With Feathers installed on your computer, create a folder for this application with the command below: Mkdir RestWithFeathers & RestWithFeathers Creating the folders If everything went well with the installation, you'd see the version number printed out on the console. Wait for the installation to complete and confirm the installation with the command below: feathers -V Confirming the installation To get started, open your command-line interface and create a folder for this tutorial with the command below: npm install -save Installing Feathers ![]() You'll learn to use Sequelize to correlate tables in Feathers.js, restrict access to specific routes, and link your database to Arctype. The administrator will generate movies in this program, and authenticated users will be able to rent them. You will create a movie rental application to illustrate the capabilities of Feathers.js and Arctype database visualization tools. Prior knowledge of Node.js and Express.js.To get started, I assume you have the following: This tutorial is a hands-on demonstration. With Feathers, all you need to add a feature is to run a simple command. What is Feathers.jsįeathers is a lightweight web framework for developing real-time apps and REST APIs in JavaScript or TypeScript.įeathers can interact with any backend technology, supports over a dozen databases, and works with any frontend technology, such as React, VueJS, Angular, and React Native.įeathers.js is well-known for its ease of use and rapidity of delivery, and extensive documentation. We'll learn about Feathers.js, implement an example API, and share some thoughts and considerations. Looking for a way to build a web application with features like authentication, database setup, and authorization without writing a ton of code and configurations? Ever wanted to create a production-ready app in a matter of days?īelieve it or not, it's possible! This tutorial will show you how to use Feathers.js to create a REST API in minutes.
0 Comments
Leave a Reply. |