1.0.0 • Published 4 years ago

@mobilabs/wapi v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Wapi

NPM version GitHub last commit Travis CI Test coverage Dependencies status Dev Dependencies status License

Wapi is a slim, fast and minimal API framework built on top of Express.JS. It is built to provide a flexible API consumable from other apps.

Quick Startup

You can easily get your first Wapi Server running in a couple of minutes by just typing a few command lines. But first, you need to create an empty folder. It will contain your project.

Then, you just need to create a package.json file that contains:

{
  "name": "NameOfYourProject",
  "scripts": {
    "create": "npm install @mobilabs/wapi && npm run populate",
    "populate": "wapi populate --name ${npm_package_name} --author \"${npm_package_writer_name}\" --acronym ${npm_package_writer_acronym} --email ${npm_package_writer_email} --url ${npm_package_writer_url} && npm install"
  },
  "writer": {
    "name": "John Doe",
    "acronym": "jdo",
    "email": "jdo@johndoe.com",
    "url": "http://www.johndoe.com/"
  }
}

Replace NameOfYourProject by your project name and fill writer with your credentials.

And finally, type in the terminal:

npm run create.

Your project is almost ready. As, Wapi relies on https, you have to add your certificates in the folder server/ssl or you can disable https (not recommended) in server/config.js.

Now you can starts your server by typing:

npm run app

You should get a list of messages telling that the server is running. If you want to observe transactions, you can open a second terminal and type npm run test.

Documentation

You can find a detailed documentation here that details how to build your own API server from this one.

License

MIT.