2.6.9 • Published 1 year ago

strapi-plugin-pfapi v2.6.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

tests release

Strapi plugin pfapi

Pfapi plugin uses pfapi-core library to provide fast, secure, configurable, and scalable API services for e-commerce web apps.

  • Pfapi uses local and Redis caches to achieve single-digit milliseconds on average API response time.
  • IP unlimited / blocked lists, Rate limits and activities log are accessible through the admin panel.
  • API handles for detail and list views are powered by highly configurable components dynamic zone.
  • Configurable filters enable user-friendly UX for users to find what they are looking for.
  • Production environment that runs multiple Strapi servers and Redis cluster is supported and tested.

Requirements

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.

How to install

yarn add strapi-plugin-pfapi

OR

npm install strapi-plugin-pfapi

Click to see full documentation

Setup Demonstration

With the world cities test data set provided by plugin strapi-plugin-pfapi-data, we can run API calls to demonstrate the idea.

step 1 install Redis server

Please refer to Redis getting started to install redis server on your local computer.

step 2 create strapi app

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.

step 3 install plugins

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

step 4 setup api_key and permissions

get your api_key from:

http://localhost:1337/admin/content-manager/collectionType/plugin::pfapi.pfapi-key?page=1&pageSize=10&sort=key:ASC

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:

http://localhost:1337/admin/settings/users-permissions/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.

step 5 demos

a) tests content-type name world-cities as path variable

http://localhost:1337/pfapi/world-cities?api_key=Pfapi-Demo

http://localhost:1337/pfapi/world-cities/2148?api_key=Pfapi-Demo

b) tests config handle northern-cities as path variable

handle configs are defined in PfapiHandle.

/pfapi

http://localhost:1337/pfapi/northern-cities?api_key=Pfapi-Demo

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

strapi api parameters

http://localhost:1337/pfapi/northern-cities?filters[iso3]=USA&api_key=Pfapi-Demo

c) tests with config handle northern-city with id_field is name

config data defined in PfapiHandles for handle northern-city:

http://localhost:1337/pfapi/northern-city/Anchorage?api_key=Pfapi-Demo

d) test data update

goto http://localhost:1337/admin/content-manager/collectionType/api::world-city.world-city/2148

make some change, for example: change the population from 288000 to 288001

check APIs:

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

http://localhost:1337/pfapi/northern-city/Anchorage?api_key=Pfapi-Demo

to see if the cached data was evicted and updated

e) test config update

goto http://localhost:1337/admin/content-manager/collectionType/plugin::pfapi.pfapi-handle/1

make some changes, for example: add or remove country to the fields array

check APIs:

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

2.6.9-beta.0

1 year ago

2.6.5

2 years ago

2.6.7

2 years ago

2.6.6

2 years ago

2.6.9

1 year ago

2.6.8

1 year ago

2.6.3

2 years ago

2.6.3-beta.0

2 years ago

2.6.4

2 years ago

2.6.2

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.5.23

2 years ago

2.5.22

2 years ago

2.5.22-beta.0

2 years ago

2.5.21

2 years ago

2.5.21-beta.0

2 years ago

2.5.20

2 years ago

2.5.19

2 years ago

2.5.19-beta.0

2 years ago

2.5.18

2 years ago

2.5.18-beta.0

2 years ago

2.5.17

2 years ago

2.5.17-beta.0

2 years ago

2.5.16

2 years ago

2.5.16-beta.0

2 years ago

2.5.15

2 years ago

2.5.14-beta.3

2 years ago

2.5.14

2 years ago

2.5.14-beta.1

2 years ago

2.5.12-beta.0

2 years ago

2.5.9

2 years ago

2.5.9-alpha.1

2 years ago

2.5.9-alpha.0

2 years ago

2.5.8

2 years ago

2.5.6

2 years ago

2.5.3

2 years ago

2.5.1

2 years ago

2.5.0

2 years ago

2.4.8-alpha.3

2 years ago

2.4.8-alpha.2

2 years ago

2.4.8-alpha.1

2 years ago

2.4.7

2 years ago

2.4.6

2 years ago

2.4.5

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.3.9

2 years ago

2.3.8

2 years ago

2.3.7

2 years ago

2.3.6

2 years ago

2.3.5

2 years ago

2.3.3

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.3.0

2 years ago

2.2.9

2 years ago

2.2.8

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.2.5

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.9

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

2.1.5

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.2

2 years ago

2.0.0

2 years ago

1.9.9

2 years ago

1.9.8

2 years ago

1.9.7

2 years ago

1.9.6

2 years ago

1.9.5

2 years ago

1.9.3

2 years ago

1.9.2

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

1.8.9

2 years ago

1.8.8

2 years ago

1.8.7

2 years ago

1.8.6

2 years ago

1.8.3

2 years ago

1.8.2

2 years ago

1.8.1

2 years ago

1.8.0

2 years ago

1.7.9

2 years ago

1.7.8

2 years ago

1.7.7

2 years ago

1.7.6

2 years ago

1.7.5

2 years ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.9

2 years ago

1.6.8

2 years ago

1.6.7

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.8

2 years ago

1.5.5

2 years ago

1.5.3

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.1

2 years ago

1.1.9

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago