![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | server/ | 2 years ago | - | |
![]() | LICENSE | 40 years ago | 1.0K | |
![]() | README.md | 40 years ago | 2.7K | d7c1522 post receive test [كارل مبارك] |
![]() | jest.config.js | 40 years ago | 253 | |
![]() | package.json | 2 years ago | 2.5K | |
![]() | strapi-server.js | 40 years ago | 53 |
A plugin for Strapi that provides the ability to transform the API response.
The installation requirements are the same as Strapi itself and can be found in the documentation on the Quick Start page in the Prerequisites info card.
NOTE: While this plugin may work with the older Strapi versions, they are not supported, it is always recommended to use the latest version of Strapi.
npm install strapi-plugin-transformer
or
yarn add strapi-plugin-transformer
The plugin configuration is stored in a config file located at ./config/plugins.js
.
module.exports = ({ env }) => ({
'transformer': {
enabled: true,
config: {
prefix: '/api/'
}
},
});
IMPORTANT NOTE: Make sure any sensitive data is stored in env files.
Property | Description | Type | Default | Required |
---|---|---|---|---|
prefix | The prefix for the API | String | '/api/' | No |
Once the plugin has been installed, configured and enabled any request to the Strapi API will be auto transformed.
{
"data": {
"id": 1,
"attributes": {
"title": "the title",
"createdAt": "2022-02-11T01:51:49.902Z",
"updatedAt": "2022-02-11T01:51:52.797Z",
"publishedAt": "2022-02-11T01:51:52.794Z",
},
},
"meta": {},
}
{
"data": {
"id": 1,
"title": "the title",
"createdAt": "2022-02-11T01:51:49.902Z",
"updatedAt": "2022-02-11T01:51:52.797Z",
"publishedAt": "2022-02-11T01:51:52.794Z",
},
"meta": {},
}
If any bugs are found please report them as a Github Issue