![From Academia to Industry](https://cdn.sanity.io/images/cgdhsj6q/production/70501690bf807891573e259da9719cf24302c7e3-4288x2848.jpg?w=400&fit=max&auto=format)
Employee Spotlight
From Academia to Industry
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
ez-js-rest-client
Advanced tools
Readme
This repository provides a JavaScript library meant to ease the usage of the eZ Publish REST API.
The eZ Platform JavaScript REST Client is a bower package, so the easiest way to install it is to run:
$ bower install --save ezsystems/ez-js-rest-client
Then you can include in your project the file
bower\_components/ez-js-rest-client/dist/CAPI-min.js
(or the non minified
version). It's also possible to directly take dist/CAPI.js
or
dist/CAPI-min.js
in a clone of this repository.
The usage the JavaScript REST Client is detailed in Using the JavaScript REST API Client
The project maintenance is handled in a nodejs based environment with a help of Grunt task runner.
$ npm install
# npm install -g grunt-cli yuidocjs
The JavaScript API documentation can be generated in the api
directory with:
$ grunt doc
Alternatively, you can run
$ grunt livedoc
to run the yuidoc documentation server. The dynamic documentation can then be reached at http://127.0.0.1:3000.
The library can be built with:
$ grunt build
This command will (re)generate the files dist/CAPI.js
and dist/CAPI-min.js
.
#### Unit tests
The unit tests can be executed with:
$ grunt test
It's also possible to generate a coverage report with:
$ grunt coverage
After this command, the report is available in
test/coverage/lcov-report/index.html
.
During development it may be quite handy to automatically rerun unit-tests and/or lint checks, once any project related file has changed.
Using so called watch
tasks this can easily be achieved. Currently the following
of those tasks exist:
watch:lint
: On each file change execute a linting runwatch:test
: Execute a unit-test run on each file changeThe library can be manually tested by installing the Symfony2 bundle jsRestClientBundle, which is situated in the test/manual/ folder.
Before bundle installation run grunt build
command once. It will build all the
source files into Resources/public/js/CAPI.js file.
Then the bundle could be installed into your current ezPublish 5.x instance using following instruction:
Create path/to/ezpublish5/src/EzSystems
if it does not exist.
Symlink the bundle into /src/EzSystems/ (keep folder name).
Edit /app/AppKernel.php and add the following line before in the return statement of the method registerBundles:
$bundles[] = new EzSystems\jsRestClientBundle\jsRestClientBundle();
Import routing.yml file of the bundle into main routing file by adding the
following lines at the very bottom of ezpublish/config/routing.yml
:
jsRestClientBundle:
resource: "@jsRestClientBundle/Resources/config/routing.yml"
Clear the Symfony 2 caches with app/console.
After these steps you may access /js-rest-client-test/
path where you will find
testing html page. Most of requests can be configured a little bit before
executing them by changing input values. See details of tests implementation in
Resources/public/js/cookbook-*.js files.
FAQs
eZ Platform JavaScript REST client
The npm package ez-js-rest-client receives a total of 3 weekly downloads. As such, ez-js-rest-client popularity was classified as not popular.
We found that ez-js-rest-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Employee Spotlight
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
Security News
Git dependencies in open source packages can introduce significant risks, including lack of version control, stability issues, dependency drift, and difficulty in auditing, making them potential targets for supply chain attacks.
Security News
Node.js has added experimental support for TypeScript, a move that highlights the growing importance of TypeScript in modern development.