Guide to creating an API with Strapi

submited by
Style Pass
2020-06-27 05:18:52

Content management systems (CMSs) have been around for quite some time. Strapi is a headless CMS for Node.js that provides a GUI for creating different content types and user management baked into the platform. It supports both RESTful API and GraphQL.

In addition, Strapi supports both NoSQL and SQL databases. Changing the database is as simple as changing environment variables.

Strapi requires Node.js installed on the system. It provides a boilerplate generator, create-strapi-app, for setting up the application. It can be installed globally using npm with the following command.

Using create-strapi-app is simple; just pass the name of the project. --quickstart will create a project with a default setting.

You must create an admin user before using Strapi. The command npm run develop starts the server on http://localhost:1337. The admin user is created using http://localhost:1337/admin/auth/register.

Strapi provides easy UI for the creation of database schema. For changing configuration, we have to edit out project files. For example, for changing the env variable we have to edit the config/environments folder.

Leave a Comment