Pfapi plugin provides fast, secure, configurable, and scalable API services for e-commerce web apps.
Pfapi plugin uses pfapi-core library to provide fast, secure, configurable, and scalable API services for e-commerce web apps.
Pfapi plugin is a Strapi version 4 plugin. It requires the in-memory data store Redis. Please refer to Redis getting started to install redis server for your environment.
yarn add strapi-plugin-pfapi OR npm install strapi-plugin-pfapi
With the world cities test data set provided by plugin strapi-plugin-pfapi-data, we can run API calls to demonstrate the idea.
Please refer to Redis getting started to install redis server on your local computer.
yarn create strapi-app strapi-pfapi-app --quickstart OR npx create-strapi-app strapi-pfapi-app --quickstart
After creating and logging into your Strapi account from the browser, stop the strapi server.
You don't have to install strapi-plugin-pfapi-data for your production.
strapi-plugin-pfapi-data provides a test data set for demo and test
cd strapi-pfapi-app yarn add strapi-plugin-pfapi strapi-plugin-pfapi-data yarn develop OR npm install strapi-plugin-pfapi strapi-plugin-pfapi-data npm run develop
get your api_key from:
Please replace Pfapi-Demo-XXXXXXXX with Pfapi-Demo for the convenience of using links posted below.
A role with name PfapiDemo is installed in the above steps.
Go to Settings > USERS & PERMISSIONS PLUGIN > Roles:
click on PfapiDemo,
Under Permissions > World-city
assign find and findOne permissions to PfapiDemo and click save.
OK, we are ready to run demos.
handle configs are defined in PfapiHandle.
strapi api parameters
config data defined in PfapiHandles for handle northern-city:
make some change, for example: change the population from 288000 to 288001
to see if the cached data was evicted and updated
make some changes, for example: add or remove country to the fields array
npm install strapi-plugin-pfapi
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.