Code Monkey home page Code Monkey logo

handbook's Introduction

The Nodejitsu Handbook

You can view the Handbook online at https://www.nodejitsu.com/documentation

Welcome to the Nodejitsu handbook. This document will help familiarize you with deploying your Node.js applications to the cloud while also providing detailed information about Nodejitsu's platform-specific features and about where to get help when you need it.

This is a living document which you can submit patches to at http://github.com/nodejitsu/handbook. Handbook content resides in /content and is easily accessed by using several methods of /index.js,

Adding content

Writing a new article is done by simply adding a Markdown file to a subdirectory. Several articles with related content can be placed under a seperate/new subdirectory. Only markdown files included in the catalog.

Note: each subdirectory is expected to at least have an index.md to generate a proper catalog.

Moving around content

When you want to move content or complete folders you should update the 301.json file that is in the root of the git repository. This way implementors can redirect urls easily without getting 404's. If you are removing content you don't need to change anything as it's supposed to 404.

Images

Images must be added to /resource. Our CDN will ensure images are fetched from the repository and properly cached. Linking to an image from the article should be done as below:

![no applications](https://versions.nodejitsu.com/id:handbook/resources/noapps.png)

Using the handbook as module

Simply add handbook as dependency to the package.json, make sure to call the handbook constructor, otherwise the search index will not be initialized properly.

var Handbook = require('handbook'),
    documentation = new Handbook();

documentation.search('query');

Get markdown content

Call handbook.get('/a-quickstart/hello-world') with a relative path to the article as first parameter, adding .md is optional.

will return an object with keys content, description, title and tags. For more details about data for all keys, see Description, title and tags.

{
  content: '##Some markdown content\n\nWhich is not parsed yet.',
  description: 'description parsed from content',
  title: 'title parsed from content',
  tags: [
    'top', 'ten', 'unique', 'descriptive', 'words', 
    'without', 'numbers', 'and', 'short', 'tags'
  ] 
}

Get the catalog

Call handbook.catalog() to acquire a complete catalog from content (sychronously), which should return an object with paths, href's, titles and descriptions. If you want to generate the catalog asynchronously then supply a callback to the function.

{ 
  index: { 
    index: { 
      href: '',
      title: 'Handbook',
      description: '# Introduction\n\nWelcome to the Nodejitsu handbook. This document will help familiarize you with\ndeploying your Node.js applications to the cloud while also providing detailed\ninformation about Nodejitsu\'s platform-specific features and about\nwhere to get help when you need it.',
      path: '/var/www/nodejitsu/handbook/content' 
    } 
  },
  support: { 
    index: { 
      href: '/support',
      title: 'Need Support?',
      description: '# Need Support?\n\nNodejitsu has a team of developers standing by to assist users with any issues\nthey may come across while deploying and administrating their web applications\non the Nodejitsu platform. Nodejitsu strives to have a lightning-fast turnaround\non all issues you may have!',
      path: '/var/www/nodejitsu/handbook/content/support' 
    } 
  }
}

Description, title and tags

Adding a description and title to the article is as easy as providing it at the bottom of the content as per example. Omitting title and/or description is possible. The description will be parsed from the first lines of the content. The title will be returned with an empty string.

[meta:title]: <> (Using the jitsu CLI)
[meta:description]: <> (Some nice description about the content of the article)

Tags are parsed from the content by using Term Frequecy-Inverse Document Frequency. Ten of the most descriptive tags are returned by default. Currently, there is no support for custom tags.

Lunr search

Handbooks search engine is powered by Lunr. The handbook#search method is a simple proxy to Lunr search.

handbook's People

Contributors

3rd-eden avatar avianflu avatar beriberikix avatar blakmatrix avatar bmoeskau avatar coderarity avatar cronopio avatar dscape avatar edef1c avatar indexzero avatar itsjoesullivan avatar jcrugzz avatar jeffmjack avatar jeffsu avatar jfhbrook avatar jhs avatar julianduque avatar jvduf avatar klaemo avatar lackac avatar marak avatar mlybrand avatar mmalecki avatar na avatar orthographic-pedant avatar panzi avatar pksunkara avatar shaunspringer avatar southern avatar yawnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

handbook's Issues

Detail drone specs

For both business and individual drones sizes.

E.g.

Q How much RAM, processing power, and disk space am I getting per drone?
A You get 256MB of ram, aprox. 5GB of disk space, and one virtual CPU (as defined per joyent). This is only guaranteed to be exclusively used by your application if you buy a business plan.

Will my app be down if a deploy fails

Question to add to the faq. This is the question and answer from a customer:

Q: When we push our app to Nodejitsu, does it start a new instance, then cut the traffic over from the old one if successful? Or would the app be down if something went wrong?
A: We always provision a new virtual machine. The old one gets decommissioned if and only if everything went ok, so a failed deploy does not equate to down time.

redis example: use javascript parser

Hey,
while deploying an app that uses node_redis to nodejitsu I noticed that the hiredis parser doesn't seem to work.
So I passed { parser: 'javascript' } to redis.createClient as mentioned in the node_redis docs

Unless there is something inherently wrong with this solution, I think it should be added to the redis section of the handbook.

Cheers,
Clemens

Frequently Asked Questions

There's an obvious need for a "frequently asked questions" section in the handbook. A stub for this exists, but only has a few questions. I know there are more FAQ issues people have been dealing with, so I'd like to open things up for input.

Current FAQ:

https://github.com/nodejitsu/handbook/blob/master/chapters/faq.md

Items currently in the FAQ:

  • "How are programs kept alive? Do I need to use Forever?"
  • "How can I make my app use a port other than port 80?"
  • Why won't c++ module X install?

Items to be added to the FAQ:

I heard that @bmeck has a few FAQs in mind, and I'm sure that @Marak and @AvianFlu can think of a few more common support issues for the FAQ.

Document custom domains / setting up a TLD

I know that the new generated package.json is a bit different now. It would be sweet to have a short section on using a custom domain, and setting up it's A record versus having to ask? :P I can just fork if you want

Does nodejitsu use sticky-sessions

I assume you use sticky sessions for load balancing across drones? I couldn't find any documentation on it though, so I wanted to check before I scale a real-time app to 3 drones and break everything.

API to view logs by app ignore params

The call to view logs for an app seems to ignore whatever parameters I send for "from" (I'm sending a JSON object with a "from" property with a string value of the exact timestamp I received from an earlier call). I'm trying to poll for new logs by asking for any logs "from" the timestamp I received of the last log. The response seems to ignore this passed value and the "context" object returned always seems to have the default values in it.

Top support questions not addressed in handbook.

Top support questions im getting...

  1. how are programs kept alive? do i need forever?

  2. how to host my domains/how is DNS handled

  3. how to run something on a port other than port 80

  4. how do I run something that requires an external binary to be started

jitsu --release [major|minor|patch|build]

We need to document this. We default to build, but anyone can increment any part of their package.json running:

  jitsu config set release [major|minor|patch|build]
  #
  # OR
  #
  jitsu --release [major|minor|patch|build]

Detail how addons work

Some of our users think databases work in localhost, while we actually use dbaas providers to give them data. It would be nice to detail this in the FAQ.

Better explain hosting options

It's not possible to have more than one listening HTTP service per application; this and other caveats should be thoroughly documented. Suggestions very much welcome.

Forcing SSL on nodejitsu

This question gets asked enough times its worth putting into the handbook need 2 examples, one for basic http server, and express.

PDF and HTML generation (somewhat) broken

Some issues with the pdf and html generation:

  • HTML comments are visible
  • Triple backquotes (```) are not supported
  • Inlined images may not be properly scaled, especially if they're wider than a page.
  • Some links become broken due to interactions with something else (currently unidentified), probably related to the html comments issue.

The obvious long-term solution is to spend the time to fix the pdf generation tool to handle these issues. In the short term, we can:

  • Remove content that the pdf/html generation tool finds offensive, such as html comments and triple backquotes.
  • Not generate pdf or html until the pdf/html generation is fixed.

Support for Node v0.8?

The README only mentioned v0.4 and v0.6, so wasn't sure if you guys are still working on support or the documentation needs to be updated. Thanks!

Document what SNI-base HTTPS is

It doesn't work on some common versions of OpenSSL so curl https://sub.jit.su will return false positives since our load balancers use SNI-based HTTPS.

nodejitsu options in `package.json`

IRC log:

23:16 < fatjonny> is there a list somewhere of all the extra properties that can be in the package.json that nodejitsu uses?
23:18 <@Marak> fatjonny: maybe in the handbook?
23:18 <@Marak> there might not be a central place for that, jesusabdullah ?
23:21 < fatjonny> Marak: I didn't see it in there. Would it be in the jitsu code or a different lib where I could look to see?
23:21 < fatjonny> I am mostly curious since I learned about the domains property earlier. :)
23:21 <+mmalecki> fatjonny: haibu and haibu-carapace code, mostly
23:21 <@Marak> its hard to say, ill look into it. some of its in haibu
23:21 <@Marak> yeah
23:21 <@Marak> most of it is there
23:22 <+mmalecki> fatjonny: but true, there should be a central place for it
23:22 <+mmalecki> fatjonny: mind if I paste this log as an issue description?
23:22 <+jesusabdullah> fatjonny Marak There isn't a list in the handbook, but I think there should be
23:23 <+jesusabdullah> mmalecki: Yeah, file that in the handbook
23:23 < fatjonny> mmalecki: Go right ahead

Hostname/IP doesn't match certificate's altnames

We should add this question to our FAQ:

 I just tried out nodejitsu but got an error during the deployment. error: Error running command deploy error: Hostname/IP doesn't match certificate's altnames

bug (jitsu env list)

C:\Users\chenjie-yjzx>jitsu env list
info: Welcome to Nodejitsu flufy3d
info: It worked if it ends with Nodejitsu ok
info: Executing command env list
error: Error running command env list
error: No package found at C:\Users\chenjie-yjzx/package.json
info: Nodejitsu not ok

cannot deploy test project

when i tried to deploy server.js i got the following error:

jitsu deploy
info: Welcome to Nodejitsu miro
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn: There is no package.json file in D:\Mirodil\chat\myapp
warn: Creating package.json at D:\Mirodil\chat\myapp\package.json
help:
help: A package.json stores meta-data about your application
help: In order to continue we'll need to gather some information about your a
pp
help:
help: Press ^C at any time to quit.
help: to select a default value, press ENTER
prompt: App name: (myapp) myapp
prompt: subdomain: (miro.myapp) myapp
prompt: scripts.start: (server.js) server.js
prompt: version: (0.0.0) 0.0.1
error: Unable to add properties to package description.
error: [TypeError: Object function valid(version) {
if (typeof version !== "string") return null
return exports.parse(version) && version.trim().replace(/^[v=]+/, '')
} has no method 'test']
error: TypeError: Object function valid(version) {
if (typeof version !== "string") return null
return exports.parse(version) && version.trim().replace(/^[v=]+/, '')
} has no method 'test'
error: Error running command deploy
info: Nodejitsu not ok

Remove markup

remove all markup files/images from repo. (use .gitignore)

Add better documentation for deployment process

We need to add more detailed information about the deployment process so third-party developers can integrate with our system.

This information should probably go into a supplemental section instead of the main API docs.

Error spawning drone: no matching engine found

warn: About to write /home/warren/node_projects/socket-io-chat-app/package.json
data:
data: {
data: subdomain: 'warrenchat',
data: engines: { node: '0.8.2' },
data: name: 'warren_chat',
data: scripts: { start: 'warren-chat-app.js' },
data: description: 'node.js chat application with socket.io',
data: version: '0.0.1',
data: dependencies: { socket.io: '0.9.6', express: '2.5.10' }
data: }
data:
prompt: Is this ok?: (yes) yes
info: Analyzing your application dependencies in warren-chat-app.js
info: Checking app availability warren_chat
info: Creating app warren_chat
info: Creating snapshot 0.0.1
info: Updating app warren_chat
info: Activating snapshot 0.0.1 for warren_chat
info: Starting app warren_chat
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy your application.
error:
error: Error spawning drone: no matching engine found
error: Repository configuration
error:
error: This type of error is usually a user error.
error: Error output from Haibu:
error:
error: Error: Error spawning drone: no matching engine found
error: at [object Object].getSpawnOptions (/root/haibu-orchestra/node_modules/haibu/lib/haibu/core/spawner.js:34:17)
error: at [object Object].getSpawnOptions (/root/haibu-orchestra/node_modules/haibu/lib/haibu/plugins/useraccounts.js:34:31)
error: at spawnNpm (/root/haibu-orchestra/node_modules/haibu/lib/haibu/plugins/useraccounts.js:62:32)
error: at Object.oncomplete (/root/haibu-orchestra/node_modules/haibu/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js:94:5)
info: Nodejitsu not ok

Document how load balancers work in multiple datacenters

Our DNS always points to the same datacenters Note: This applied to more than jit.su: nodejitsu.com and jitsu.com:

  • Joyent
    • us-east-1: *.jit.su
    • us-sw-1: *.jyt.us.sw1.jit.su
    • eu-ams-1: *.jyt.eu.ams1.jit.su
  • Telefonica
    • eu-lon-1: *.tf.eu.lon1.jit.su

Redis syntax error in handbook

The section on databases (https://github.com/nodejitsu/handbook/#databases) gives the redis client code as

var client = redis.createClient('subdomain.redistogo.com, 5309);

but according to node_redis docu (https://github.com/mranney/node_redis/#rediscreateclientport-host-options) the correct syntax should be redis.createClient(port, host, options), ie.

var client = redis.createClient(5309, 'subdomain.redistogo.com');

Likely a minor typo on the author's part, hope this helps other node_redis newbies.

In jitsu.md the 'jitsu install helloworld' example is incorrect.

I don't think it is necessary to create a helloworld directory in /tmp/ because 'jitsu install helloworld' will make the 'helloworld' directory for you. The way this example is now will install the app under: /tmp/helloworld/helloworld/

josh@onix:/tmp$ mkdir helloworld
josh@onix:/tmp$ cd helloworld
josh@onix:/tmp/helloworld$ jitsu install helloworld
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command install helloworld
info: Installing helloworld locally.
warn: Downloading packages from npm, this may take a moment...
info: helloworld installed.
help: You can now jitsu deploy this application
prompt: Would you like to start this application locally? (yes): no
info: Nodejitsu ok
josh@onix:/tmp/helloworld$ ls
bin node_modules package.json ReadMe.md

FAQ error

In the FAQ, jitsu apps forgot :username should be jitsu users forgot :username

Handbook is too plain looking

Can we style it up a little? We should be able to add custom CSS styles for the HTML rendering and the PDF rendering. The markdown we can't do much CSS, but we can insert an image or two.

Improve document generation process

Right now, the handbook is a collection of markdown files that are stacked together and parsed by ronn and make. I think we can do better.

Ideally, this is what we would want:

  1. An html representation.
  2. A .pdf or other "book" format.

It may make sense to build a docs-style site for our handbook, and then build an "equivalent" generator for .pdf documents.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.