PHPackages                             crodas/api-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. crodas/api-server

ActiveLibrary[API Development](/categories/api)

crodas/api-server
=================

API Server with PHP and MongoDB

v0.1.2(10y ago)060MIT

Since Mar 20Compare

[ Source](https://github.com/crodas/ApiServer)[ Packagist](https://packagist.org/packages/crodas/api-server)[ RSS](/packages/crodas-api-server/feed)WikiDiscussions Synced yesterday

READMEChangelogDependencies (2)Versions (5)Used By (0)

ApiServer
=========

[](#apiserver)

Deadly simple API µServer.

It was designed for Javascript clients:

1. Speaks JSON out of the box
2. API calls are buffered for 50ms waiting for other requests to join
    1. The less we talk to the server the better.
3. The server is implemented from scratch keeping easy of use in mind:
    1. API handlers are PHP functions or methods which are discovered with annotations
    2. Everything is compiled for speed.

How to use it
-------------

[](#how-to-use-it)

The bootstrap code (index.php) should look like this:

```
require __DIR__ . '/vendor/autoload.php';

$api = new crodas\ApiServer(
    __DIR__ . '/src/services' // my apis
);

$api->main();
```

```
/** @API array_sum */
function do_array_sum($args, $server) {
    return array('array_sum' => array_sum($args));
}
```

A `client` is included in `client/dist` (You can build the source with `bower install; gulp dist`).

```
Server.setUrl("http://api.foobar.com");
Server.exec("array_sum", [1,2,3]).then(function(result) {
    console.error(result);
});
Server.exec("array_sum", [2,3]).then(function(result) {
    console.error(result);
});
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

3755d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36463?v=4)[C](/maintainers/crodas)[@crodas](https://github.com/crodas)

### Embed Badge

![Health badge](/badges/crodas-api-server/health.svg)

```
[![Health](https://phpackages.com/badges/crodas-api-server/health.svg)](https://phpackages.com/packages/crodas-api-server)
```

###  Alternatives

[oat-sa/tao-core

TAO core extension

66143.7k116](/packages/oat-sa-tao-core)[gnello/php-mattermost-driver

The Php Driver to interact with the Mattermost Web Service API

86318.7k6](/packages/gnello-php-mattermost-driver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
