Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Create gh-pages branch via GitHub

  • Loading branch information...
commit 1ff5a75b3d1391ce2a5b6ad624f5791f5ff9caea 1 parent ec34ad1
@DukeyToo DukeyToo authored
View
15 index.html
@@ -24,7 +24,7 @@
<div id="banner">
<span id="logo"></span>
- <a href="https://github.com/perfectapi/node-perfectapi" class="button fork"><strong>Fork On GitHub</strong></a>
+ <a href="https://github.com/perfectapi/node-perfectapi" class="button fork"><strong>View On GitHub</strong></a>
<div class="downloads">
<span>Downloads:</span>
<ul>
@@ -32,7 +32,6 @@
<li><a href="https://github.com/perfectapi/node-perfectapi/tarball/master" class="button">TAR</a></li>
</ul>
</div>
-
</div><!-- end banner -->
<div class="wrapper">
@@ -40,7 +39,11 @@
<ul></ul>
</nav>
<section>
- <h2>Package Goals</h2>
+ <h2>Note</h2>
+
+<p>I am not currently maintaining this package. You should probably look for another tool for what you need.</p>
+
+<h2>Package Goals</h2>
<p>The goals of this package are to support:</p>
@@ -209,7 +212,7 @@
<li>references a proxy endpoint (e.g. <a href="http://myserver.com:3000/apis">http://myserver.com:3000/apis</a>) instead of the downloaded Node package</li>
<li>user code executes in a callback (because we have to wait for the endpoint to be validated and the proxy created)</li>
</ul><pre><code>var perfectapi = require('perfectapi');
-perfectapi.proxy('<a href="http://myserver.com:3000/apis">http://myserver.com:3000/apis</a>', function(err, test1) {
+perfectapi.proxy('http://myserver.com:3000/apis', function(err, test1) {
var config = {}
test1.mycommand(config, function(err, result) {
@@ -225,7 +228,7 @@
<h2>Usage from C# (.NET Framework 4.0 or higher)</h2>
-<p>When running as a service, the service endpoint exposes a C# client at <code><a href="http://myserver.com/myapi/myapi.cs">http://myserver.com/myapi/myapi.cs</a></code>. 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:</p>
+<p>When running as a service, the service endpoint exposes a C# client at <code>http://myserver.com/myapi/myapi.cs</code>. 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:</p>
<ul>
<li>System</li>
@@ -271,7 +274,7 @@
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="http://twitter.com/#!/michigangraham">mattgraham</a></small></p>
</footer>
</div>
- <!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
+ <!--[if !IE]><script>fixScale(document);</script><![endif]-->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
View
5 javascripts/main.js
@@ -19,9 +19,9 @@ $(document).ready(function(){
$("nav ul li:first-child a").parent().addClass("active");
});
- $("nav ul li a").live("click",function(event) {
+ $("nav ul li").on("click", "a", function(event) {
var position = $($(this).attr("href")).offset().top - 190;
- $("html").animate({scrollTop: position},400);
+ $("html, body").animate({scrollTop: position}, 400);
$("nav ul li a").parent().removeClass("active");
$(this).parent().addClass("active");
event.preventDefault();
@@ -50,5 +50,4 @@ fixScale = function(doc) {
scales = [.25, 1.6];
doc[addEvent](type, fix, true);
}
-
};
View
2  params.json
@@ -1 +1 @@
-{"name":"Node-perfectapi","body":"Package Goals\r\n------------\r\nThe goals of this package are to support:\r\n\r\n - Well-designed service APIs (easy to use, scales well, easy to extend, etc)\r\n - Simple usage of any API from any programming language. (Its pretty easy already, but we make it even easier)\r\n - Full support for running an API as a service on Linux and Windows operating systems\r\n - Simplicity of developement for both API authors and consumers\r\n \r\n\r\nReasons to use PerfectAPI (Current Feature list)\r\n-------------------------\r\n\r\n - 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\r\n - Easily create a self-hosted server with command-line - `myapp server -p 3002`\r\n - Support for easy configuration\r\n - 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/)\r\n - Windows and Linux installers (run your API as a true service on your server) - `myapp install myappservicename`\r\n - Automatic validation of required parameters\r\n - Local command-line access to your API\r\n - Built-in JSONP interface to your API - you can access it (easily) using JavaScript from another domain\r\n - REST-like GET/POST interface to your API\r\n - Native .NET client to your API - access from .NET without dealing with REST, JSON, WebRequest etc.\r\n - Built-in support for max-age and etag server caching - lowers your costs by doing less work\r\n \r\nIs it Perfect?\r\n--------------\r\n\r\nNo. See the [FAQ](https://github.com/perfectapi/node-perfectapi/wiki/FAQ)\r\n\r\nInstall\r\n-------\r\nThe usual for Node.js stuff\r\n\r\n $ npm install perfectapi\r\n\r\nor for a global install:\r\n\r\n $ sudo npm install -g perfectapi\r\n\r\nHow to include in your API\r\n--------------------------\r\nFirst, create a `perfectapi.json` configuration file. See [Configuration File](https://github.com/perfectapi/node-perfectapi/wiki/perfectapi-config-file-format) for details. Once you have a configuration file, a sample usage is:\r\n\r\n```\r\n#!/usr/bin/env node\r\n\r\nvar perfectapi = require('perfectapi'); \r\nvar path = require('path');\r\n\r\nvar configPath = path.resolve(__dirname, 'perfectapi.json');\r\nvar parser = new perfectapi.Parser();\r\n\r\n//handle the commands\r\nparser.on(\"mycommand\", function(config, callback) {\r\n\t//do mycommand code, putting results into \"result\" object\r\n\r\n\t//after done\r\n\tcallback(err, result);\r\n});\r\n \r\nparser.on(\"anothercommand\", function(config, callback) {\r\n\t//do anothercommand code, putting results into \"result\" object\r\n\r\n\t//after done\r\n\tcallback(err, result);\r\n});\r\n\r\n//expose the api\r\nmodule.exports = parser.parse(configPath);\r\n```\r\n\r\nIn your `package.json` file, be sure to specify the above file as a \"bin\", so that the app can be called from the command-line, e.g.\r\n\r\n```\t\r\n{ \"name\": \"myNodeLib\"\r\n, \"version\": \"0.0.1\"\r\n, \"description\": \"My brilliant API\"\r\n, \"main\": \"./bin/myNodeLib.js\"\r\n, \"bin\": \"./bin/myNodeLib.js\"\r\n, \"engines\": {\r\n \"node\" : \">=0.6.5\"\r\n }\r\n, \"dependencies\": {\r\n\t\"perfectapi\": \">=0.0.13\"\r\n }\r\n}\r\n```\r\nThats it. \r\n\r\nUsage from another Node app\r\n---------------------------\r\nOther 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.\r\n\r\n```\r\nvar test1=require('myNodeLib');\r\n\r\nvar config = {}\r\ntest1.mycommand(config, function(err, result) {\r\n\tif (err) {\r\n\t\tconsole.log('something went wrong: ' + err);\r\n\t} else {\r\n\t\tconsole.log('output = ' + JSON.stringify(result));\r\n\t}\r\n});\r\n```\r\n\r\nUsage from Javascript\r\n---------------------\r\nAssuming the service is running at http://myserver.com:3000/apis, code looks like below: \r\n\r\n```\r\n<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js\"></script>\r\n<script src=\"//myserver.com:3000/apis/jquery.perfectapi.js\"></script>\r\n\r\n<script>\r\nmyNodeLib.callApi('myCommand', config, function(err, result) {\r\n ...do stuff\r\n});\r\n</script>\r\n```\r\n\r\nUsage from command-line\r\n-----------------------\r\n\r\nExamples:\r\n\r\n```\r\n$ myapp --help\r\n\r\n Usage: myapp [options] [command]\r\n\r\n Commands:\r\n\r\n gen [options] <scripts>\r\n Generates a new Amazon EC2 image using the supplied scripts\r\n\r\n scripts [options]\r\n Lists available scripts for use in gen\r\n\r\n server [options]\r\n Run this API as a REST + JSON server\r\n\r\n Options:\r\n\r\n -h, --help output usage information\r\n```\r\nSeveral commands are added automatically - `server`, `install`, `uninstall`, `config`.\r\n\r\nFocusing on just one of the commands:\r\n\r\n```\r\n$ myapp gen --help\r\n\r\n Usage: gen [options] <scripts>\r\n\r\n Options:\r\n\r\n -h, --help output usage information\r\n -r, --root <root> specify the root folder where scripts can be found\r\n -a, --ami [ami] the AMI name that will form the basis of the new images\r\n -p, --publish if set, the resulting AMI(s) will be made public\r\n```\r\n\r\nUsage via proxy in Node\r\n-----------------------\r\nThis 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:\r\n\r\n - references a proxy endpoint (e.g. http://myserver.com:3000/apis) instead of the downloaded Node package\r\n - user code executes in a callback (because we have to wait for the endpoint to be validated and the proxy created)\r\n\r\n```\r\nvar perfectapi = require('perfectapi');\r\nperfectapi.proxy('http://myserver.com:3000/apis', function(err, test1) {\r\n\r\n\tvar config = {}\r\n\ttest1.mycommand(config, function(err, result) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log('something went wrong: ' + err);\r\n\t\t} else {\r\n\t\t\tconsole.log('output = ' + JSON.stringify(result));\r\n\t\t}\r\n\t});\r\n\t\r\n});\r\n```\r\n\r\nUsage from C# (.NET Framework 4.0 or higher)\r\n-------------\r\nWhen 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:\r\n\r\n - System\r\n - System.Core\r\n - System.Runtime.Serialization\r\n - System.Web\r\n - System.Xml\r\n - System.Xml.Linq\r\n - Microsoft.CSharp\r\n \r\nThe following is an example of usage:\r\n\r\n```\r\nusing System;\r\nusing PerfectAPI.Client;\r\n\r\nnamespace example\r\n{\r\n\tclass Program\r\n\t{\r\n\t\tpublic static void Main(string[] args)\r\n\t\t{\r\n\t\t\tvar amigen = new Amigen();\r\n\t\t\t\r\n\t\t\tvar config = new Amigen.GenConfig();\r\n\t\t\tconfig.Scripts = new string[] {@\"ubuntu11.10\\nodejs-stable\"};\r\n\t\t\tconfig.Options.Root = @\"E:\\Code\\ami-generator\\scripts\\\";\r\n\t\t\tvar result = amigen.Gen(config);\r\n\t\t\t\r\n\t\t\tConsole.WriteLine(result.RawResult);\r\n\t\t\tConsole.WriteLine(result.ParsedResult.ami);\r\n\t\t\tConsole.WriteLine(result.ParsedResult.region);\r\n\t\t\t\r\n\t\t\tConsole.Write(\"Press any key to continue . . . \");\r\n\t\t\tConsole.ReadKey(true);\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nIn 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`).","tagline":"Easier service APIs using Node.js","google":"UA-26123362-2","note":"Don't delete this file! It's used internally to help with page regeneration."}
+{"name":"Node-perfectapi","tagline":"Easier service APIs using Node.js","body":"Note\r\n----\r\nI am not currently maintaining this package. You should probably look for another tool for what you need.\r\n\r\nPackage Goals\r\n------------\r\nThe goals of this package are to support:\r\n\r\n - Well-designed service APIs (easy to use, scales well, easy to extend, etc)\r\n - Simple usage of any API from any programming language. (Its pretty easy already, but we make it even easier)\r\n - Full support for running an API as a service on Linux and Windows operating systems\r\n - Simplicity of developement for both API authors and consumers\r\n \r\n\r\nReasons to use PerfectAPI (Current Feature list)\r\n-------------------------\r\n\r\n - 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\r\n - Easily create a self-hosted server with command-line - `myapp server -p 3002`\r\n - Support for easy configuration\r\n - 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/)\r\n - Windows and Linux installers (run your API as a true service on your server) - `myapp install myappservicename`\r\n - Automatic validation of required parameters\r\n - Local command-line access to your API\r\n - Built-in JSONP interface to your API - you can access it (easily) using JavaScript from another domain\r\n - REST-like GET/POST interface to your API\r\n - Native .NET client to your API - access from .NET without dealing with REST, JSON, WebRequest etc.\r\n - Built-in support for max-age and etag server caching - lowers your costs by doing less work\r\n \r\nIs it Perfect?\r\n--------------\r\n\r\nNo. See the [FAQ](https://github.com/perfectapi/node-perfectapi/wiki/FAQ)\r\n\r\nInstall\r\n-------\r\nThe usual for Node.js stuff\r\n\r\n $ npm install perfectapi\r\n\r\nor for a global install:\r\n\r\n $ sudo npm install -g perfectapi\r\n\r\nHow to include in your API\r\n--------------------------\r\nFirst, create a `perfectapi.json` configuration file. See [Configuration File](https://github.com/perfectapi/node-perfectapi/wiki/perfectapi-config-file-format) for details. Once you have a configuration file, a sample usage is:\r\n\r\n```\r\n#!/usr/bin/env node\r\n\r\nvar perfectapi = require('perfectapi'); \r\nvar path = require('path');\r\n\r\nvar configPath = path.resolve(__dirname, 'perfectapi.json');\r\nvar parser = new perfectapi.Parser();\r\n\r\n//handle the commands\r\nparser.on(\"mycommand\", function(config, callback) {\r\n\t//do mycommand code, putting results into \"result\" object\r\n\r\n\t//after done\r\n\tcallback(err, result);\r\n});\r\n \r\nparser.on(\"anothercommand\", function(config, callback) {\r\n\t//do anothercommand code, putting results into \"result\" object\r\n\r\n\t//after done\r\n\tcallback(err, result);\r\n});\r\n\r\n//expose the api\r\nmodule.exports = parser.parse(configPath);\r\n```\r\n\r\nIn your `package.json` file, be sure to specify the above file as a \"bin\", so that the app can be called from the command-line, e.g.\r\n\r\n```\t\r\n{ \"name\": \"myNodeLib\"\r\n, \"version\": \"0.0.1\"\r\n, \"description\": \"My brilliant API\"\r\n, \"main\": \"./bin/myNodeLib.js\"\r\n, \"bin\": \"./bin/myNodeLib.js\"\r\n, \"engines\": {\r\n \"node\" : \">=0.6.5\"\r\n }\r\n, \"dependencies\": {\r\n\t\"perfectapi\": \">=0.0.13\"\r\n }\r\n}\r\n```\r\nThats it. \r\n\r\nUsage from another Node app\r\n---------------------------\r\nOther 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.\r\n\r\n```\r\nvar test1=require('myNodeLib');\r\n\r\nvar config = {}\r\ntest1.mycommand(config, function(err, result) {\r\n\tif (err) {\r\n\t\tconsole.log('something went wrong: ' + err);\r\n\t} else {\r\n\t\tconsole.log('output = ' + JSON.stringify(result));\r\n\t}\r\n});\r\n```\r\n\r\nUsage from Javascript\r\n---------------------\r\nAssuming the service is running at http://myserver.com:3000/apis, code looks like below: \r\n\r\n```\r\n<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js\"></script>\r\n<script src=\"//myserver.com:3000/apis/jquery.perfectapi.js\"></script>\r\n\r\n<script>\r\nmyNodeLib.callApi('myCommand', config, function(err, result) {\r\n ...do stuff\r\n});\r\n</script>\r\n```\r\n\r\nUsage from command-line\r\n-----------------------\r\n\r\nExamples:\r\n\r\n```\r\n$ myapp --help\r\n\r\n Usage: myapp [options] [command]\r\n\r\n Commands:\r\n\r\n gen [options] <scripts>\r\n Generates a new Amazon EC2 image using the supplied scripts\r\n\r\n scripts [options]\r\n Lists available scripts for use in gen\r\n\r\n server [options]\r\n Run this API as a REST + JSON server\r\n\r\n Options:\r\n\r\n -h, --help output usage information\r\n```\r\nSeveral commands are added automatically - `server`, `install`, `uninstall`, `config`.\r\n\r\nFocusing on just one of the commands:\r\n\r\n```\r\n$ myapp gen --help\r\n\r\n Usage: gen [options] <scripts>\r\n\r\n Options:\r\n\r\n -h, --help output usage information\r\n -r, --root <root> specify the root folder where scripts can be found\r\n -a, --ami [ami] the AMI name that will form the basis of the new images\r\n -p, --publish if set, the resulting AMI(s) will be made public\r\n```\r\n\r\nUsage via proxy in Node\r\n-----------------------\r\nThis 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:\r\n\r\n - references a proxy endpoint (e.g. http://myserver.com:3000/apis) instead of the downloaded Node package\r\n - user code executes in a callback (because we have to wait for the endpoint to be validated and the proxy created)\r\n\r\n```\r\nvar perfectapi = require('perfectapi');\r\nperfectapi.proxy('http://myserver.com:3000/apis', function(err, test1) {\r\n\r\n\tvar config = {}\r\n\ttest1.mycommand(config, function(err, result) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log('something went wrong: ' + err);\r\n\t\t} else {\r\n\t\t\tconsole.log('output = ' + JSON.stringify(result));\r\n\t\t}\r\n\t});\r\n\t\r\n});\r\n```\r\n\r\nUsage from C# (.NET Framework 4.0 or higher)\r\n-------------\r\nWhen 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:\r\n\r\n - System\r\n - System.Core\r\n - System.Runtime.Serialization\r\n - System.Web\r\n - System.Xml\r\n - System.Xml.Linq\r\n - Microsoft.CSharp\r\n \r\nThe following is an example of usage:\r\n\r\n```\r\nusing System;\r\nusing PerfectAPI.Client;\r\n\r\nnamespace example\r\n{\r\n\tclass Program\r\n\t{\r\n\t\tpublic static void Main(string[] args)\r\n\t\t{\r\n\t\t\tvar amigen = new Amigen();\r\n\t\t\t\r\n\t\t\tvar config = new Amigen.GenConfig();\r\n\t\t\tconfig.Scripts = new string[] {@\"ubuntu11.10\\nodejs-stable\"};\r\n\t\t\tconfig.Options.Root = @\"E:\\Code\\ami-generator\\scripts\\\";\r\n\t\t\tvar result = amigen.Gen(config);\r\n\t\t\t\r\n\t\t\tConsole.WriteLine(result.RawResult);\r\n\t\t\tConsole.WriteLine(result.ParsedResult.ami);\r\n\t\t\tConsole.WriteLine(result.ParsedResult.region);\r\n\t\t\t\r\n\t\t\tConsole.Write(\"Press any key to continue . . . \");\r\n\t\t\tConsole.ReadKey(true);\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nIn 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`).","google":"UA-26123362-2","note":"Don't delete this file! It's used internally to help with page regeneration."}
View
2  stylesheets/styles.css
@@ -1,5 +1,5 @@
/*
-Leap Day for Github Pages
+Leap Day for GitHub Pages
by Matt Graham
*/
@font-face {
Please sign in to comment.
Something went wrong with that request. Please try again.