Permalink
Browse files

Bump version

  • Loading branch information...
1 parent b56d0da commit 4b9c6b360129b8896b0cfe83fc0d4a051cc5e54c @DukeyToo DukeyToo committed Apr 10, 2012
Showing with 6 additions and 144 deletions.
  1. +1 −1 package.json
  2. +5 −143 readme.md
View
@@ -1,5 +1,5 @@
{ "name": "perfectapi"
- ,"version": "0.0.25"
+ ,"version": "1.0.0"
,"description": "Service API host - run a Node.js module as a service"
,"author": {"name": "Steve Campbell", "email": "steve@perfectapi.com" }
,"keywords": ["API","perfectapi","service","install","daemon","csharp","c#"]
View
148 readme.md
@@ -5,18 +5,19 @@ The goals of this package are to support:
- Well-designed APIs (easy to use, scales well, easy to extend, etc)
- Simple usage of any API from any programming language. (Its pretty easy already, but we make it even easier)
- Full support for running an API as a service on Linux and Windows operating systems
- - Simplicity of developement for both API authors and consumers
+ - Simplicity of development for both API authors and consumers
Reasons to use PerfectAPI (Current Feature list)
-------------------------
- You want to expose an API using Node.js, or you want to make an existing Node.js module accessible as a remote service API
+ - You care about performance - [4 times faster than node-restify](http://blog.perfectapi.com/2012/benchmarking-apis-using-perfectapi-vs-express.js-vs-restify.js/)
- Easily create a self-hosted server with command-line - `myapp server -p 3002`
- - Support for easy configuration
+ - Support for easy configuration via environment variables
- Awesomely amazing test page for your users to learn/experiment/test your API, e.g. [amigen api test page](http://services.perfectapi.com:3000/amigen/testapp/)
- Windows and Linux installers (run your API as a true service on your server) - `myapp install myappservicename`
- - Automatic validation of required parameters
+ - Automatic validation of required parameters (no need to code boring validation)
- Local command-line access to your API
- Built-in JSONP interface to your API - that means you can access it using JavaScript from another domain
- REST-like interface to your API
@@ -88,143 +89,4 @@ In your `package.json` file, be sure to specify the above file as a "bin", so th
```
Thats it.
-Usage from another Node app
----------------------------
-Other node apps can use your library (e.g. `myNodeLib`). This is exactly the same as you might access any other API, except that the function signature is always the same `(config, callback)` and the callback is also always the same `function(err, result)`. `result` is a return object with the structure defined in the configuration.
-
-```
-var test1=require('myNodeLib');
-
-var config = {}
-test1.mycommand(config, function(err, result) {
- if (err) {
- console.log('something went wrong: ' + err);
- } else {
- console.log('output = ' + JSON.stringify(result));
- }
-});
-```
-
-Usage from Javascript
----------------------
-Assuming the service is running at http://myserver.com:3000/apis, code looks like below:
-
-```
-<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
-<script src="//myserver.com:3000/apis/jquery.perfectapi.js"></script>
-
-<script>
-myNodeLib.callApi('myCommand', config, function(err, result) {
- ...do stuff
-});
-</script>
-```
-
-Usage from command-line
------------------------
-
-Examples:
-
-```
-$ myapp --help
-
- Usage: myapp [options] [command]
-
- Commands:
-
- gen [options] <scripts>
- Generates a new Amazon EC2 image using the supplied scripts
-
- scripts [options]
- Lists available scripts for use in gen
-
- server [options]
- Run this API as a REST + JSON server
-
- Options:
-
- -h, --help output usage information
-```
-Several commands are added automatically - `server`, `install`, `uninstall`, `config`.
-
-Focusing on just one of the commands:
-
-```
-$ myapp gen --help
-
- Usage: gen [options] <scripts>
-
- Options:
-
- -h, --help output usage information
- -r, --root <root> specify the root folder where scripts can be found
- -a, --ami [ami] the AMI name that will form the basis of the new images
- -p, --publish if set, the resulting AMI(s) will be made public
-```
-
-Usage via proxy in Node
------------------------
-This is for accessing other PerfectAPI interfaces from Node.js. The API you are accessing could be written in any language, but is written using PerfectAPI, and hosted somewhere on the Internet. The syntax is almost identical to the normal Node usage, with the following differences:
-
- - references a proxy endpoint (e.g. http://myserver.com:3000/apis) instead of the downloaded Node package
- - user code executes in a callback (because we have to wait for the endpoint to be validated and the proxy created)
-
-```
-var perfectapi = require('perfectapi');
-perfectapi.proxy('http://myserver.com:3000/apis', function(err, test1) {
-
- var config = {}
- test1.mycommand(config, function(err, result) {
- if (err) {
- console.log('something went wrong: ' + err);
- } else {
- console.log('output = ' + JSON.stringify(result));
- }
- });
-
-});
-```
-
-Usage from C# (.NET Framework 4.0 or higher)
--------------
-When running as a service, the service endpoint exposes a C# client at `http://myserver.com/myapi/myapi.cs`. You should downloaded that file (once) and incorporate it into your C# project. You will need the following references in your project, and you will need to target .NET 4 or later:
-
- - System
- - System.Core
- - System.Runtime.Serialization
- - System.Web
- - System.Xml
- - System.Xml.Linq
- - Microsoft.CSharp
-
-The following is an example of usage:
-
-```
-using System;
-using PerfectAPI.Client;
-
-namespace example
-{
- class Program
- {
- public static void Main(string[] args)
- {
- var amigen = new Amigen();
-
- var config = new Amigen.GenConfig();
- config.Scripts = new string[] {@"ubuntu11.10\nodejs-stable"};
- config.Options.Root = @"E:\Code\ami-generator\scripts\";
- var result = amigen.Gen(config);
-
- Console.WriteLine(result.RawResult);
- Console.WriteLine(result.ParsedResult.ami);
- Console.WriteLine(result.ParsedResult.region);
-
- Console.Write("Press any key to continue . . . ");
- Console.ReadKey(true);
- }
- }
-}
-```
-
-In the example above, the service name is `amigen` and the command being executed is `gen`. The command accepts a parameter named `scripts` and has an option named `root`. The results are available as raw JSON (`RawResult`) or as parsed JSON (`ParsedResult`).
+See [the website](http://perfectapi.github.com/node-perfectapi) and [wiki](http://github.com/perfectapi/node-perfectapi/wiki) for more info.

0 comments on commit 4b9c6b3

Please sign in to comment.