Catalog npm
Back to packageRELEASE DETAILS

0.0.1

npm

1api

One way to create an api over multiple protocols

Published1 Apr 2017
Direct dependencies3
Transitive dependenciesNot calculated

README

Current package documentation

1api

One way to create multiple api servers at once

Getting Started

  1. npm install --save 1api

  2. Make a basic file called index.js with the following code:


const oneApi = require('1api');

// Only a http server
const myApi = new oneApi({http: true});

// Add route
myApi.get('/welcome', (req, res) =>
    {
        console.log(req.apiMethod); // "HTTP" or "WS"
        res.status(200).send("Welcome to this module!");
    });

// create server and listen on port 3000
myApi.createServer(3000);

  1. Start de server with node index.js

  2. Open localhost:3000/welcome in the browser and you should see: Welcome to this module!.

Running the tests

All the tests are in the test folder and can be run with npm test. //TODO: Add a general test with http server and websocket server

Coding style

//TODO: Add coding style

Built With

  • NodeJS (only tested on Node v6.9.5 and should work with all newer versions)
  • Mocha and chai for testing

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. //TODO: Create CONTRIBUTING.md

Versions

0.0.1

  • Initial commit
  • Basic http- and websocket-server

Authors

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
socket.io
Environment
{
  "local_name": "socket.io",
  "alias": false,
  "peer_metadata": null
}
^1.7.3runtime
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^3.5.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^3.2.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "24bb019969f124b407cdbb8d083758823e5fa11d",
  "tarball": "https://registry.npmjs.org/1api/-/1api-0.0.1.tgz",
  "integrity": "sha512-cLAr3dDrj1fXqR9bI2iDWecmIwZvnRe/6XSpdl70X0OKQRfZj+S8KBJBWR72KG3o+shjBH4/+q1O9JQCQ7qdiA==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIEPjUMXFEdAA3If5D4dsJpCQzfkfFXO5ORfKVMdatsSgAiAvuQZiFPUWeYoMFhVHSZ5Hti8mteR1mn8UtalVUaxQvg=="
    }
  ]
}

Repository

PENDING
dirkdevisser/1api

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:25 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:6c61ba5656d02a483510b7e13ec1e375f56b0f8d24b4ef7538d5c877ca9568b0

Other collected versions

0.0.21 AprView all collected versions →