https://github.com/azer/personal-api
NodeJS API server to publish personal info.
https://github.com/azer/personal-api
Last synced: 11 months ago
JSON representation
NodeJS API server to publish personal info.
- Host: GitHub
- URL: https://github.com/azer/personal-api
- Owner: azer
- Created: 2013-12-16T10:18:51.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-06T10:01:45.000Z (over 12 years ago)
- Last Synced: 2024-11-06T15:59:46.657Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://api.azer.io
- Size: 165 KB
- Stars: 49
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## personal-api
API server to publish personal info. Example APIs: [alperkan.at](http://alperkan.at), [api.azer.io](http://api.azer.io)
```bash
$ personal-api azer.json
```
## Install
```bash
$ npm install -g personal-api
```
## Usage
Create a JSON file of your personal info:
```json
{
"name": "Azer Koçulu",
"email": "azer@kodfabrik.com",
"age": "26",
"gender": "male",
"city": "Oakland",
"hometown": "Kalkan",
"instagram": "oakazer",
"photo": "http://farm4.staticflickr.com/3674/8760363780_cdbe567873_o.jpg",
"favorite food": "mantı",
"favorite show": "leyla ile mecnun",
"religious view": "atheist"
}
```
And start the server:
```bash
$ personal-api me.json
```
Run `personal-api -h` or see `docs/man` for command-line options.
## Running Programmatically
```js
var api = require('personal-api')
api.start('me.json', 8000, 'localhost')
```
You can customize the output depending on the Accept type:
```js
api.server.format('/', 'text/plain', function (context, match) {
return {
contentType: 'text/plain',
response: 'Name: ' + context.result.name + ' E-Mail: ' + context.result.email
};
});
```
## Compatible with cats
It'll work for cats, as well. Example cat API: [blackbear.api.azer.io](http://blackbear.api.azer.io/)
