Scrivito News API
A React component/Scrivito widget which shows how to work with external REST-APIs.
Note: The free plan from newsapi.org only allows requests from localhost
Open your terminal.
$ cd to your Scrivito project
$ npm install scrivito-news-api
Add this line to your index.js:
First you need an API-Key from https://newsapi.org/register. You can save the Key in the widget configuration form. Also choose a category for the news the widget should render.
npm run build you can build the package into
npm start you'll start a continues process, that rebuilds
build/ automatically once the source code is changed.
To add this library locally do the following in your scrivito app:
npm install file:<path to build folder>
npm install file:../scrivito-news-api/build/
To publish the package:
npm i && npm run build && cd build/ && npm publish
Check code quality
npm run eslint and
npm run es-check you can check your coding quality.