{"__v":0,"_id":"588f722bbcace50f0052b9ec","category":{"version":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","_id":"588f722bbcace50f0052b9e2","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-03T19:46:10.966Z","from_sync":false,"order":0,"slug":"introduction","title":"Getting Started"},"parentDoc":null,"project":"565f5fa26bafd40d0030a064","user":"565f3941ea46251700972783","version":{"__v":1,"_id":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","createdAt":"2017-01-30T17:04:43.410Z","releaseDate":"2017-01-30T17:04:43.410Z","categories":["588f722bbcace50f0052b9e2","588f722bbcace50f0052b9e3","588f722bbcace50f0052b9e4","588f722bbcace50f0052b9e5","588f722bbcace50f0052b9e6","588f722bbcace50f0052b9e7"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.3.0","version":"5.3.0"},"updates":["57e55022685f7c19007fba54","57ea88381780cd170064f27a"],"next":{"pages":[],"description":""},"createdAt":"2015-12-03T20:47:08.789Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"This guide will step you through the process of getting started with nanoscale.io - from registration, to initial setup, to importing and running a sample Hello World API Endpoint. \n\n## 1. Register at nanoscale.io for your free account!\n\nIf you have not yet done so, go <a target=\"_blank\" href=\"https://dashboard.nanoscale.io/#/registration\">register for a free account on nanoscale.io</a>.\n\nYou'll receive a confirmation email. Be sure to open it and click the confirmation link. If you don't do this, you won't be able to get into your account.\n\n## 2. Open the nanoscale.io Dashboard\n\nLaunch the <a target=\"_blank\" href=\"https://dashboard.nanoscale.io/\">nanoscale.io Dashboard</a> and login to your main account page.\n\n## 3. Navigate to the Define APIs page\n\nClick on the <a target=\"_blank\" href=\"https://dashboard.nanoscale.io/#/apis\">Define APIs</a> circle on the far left.\n\n## 4. Define your very first API\n\nFirst, go <a target=\"_blank\" href=\"http://downloads.nanoscale.io/latest/samples.json\">download the Sample API</a> that we've built. This API demonstrates a lot of what nanoscale.io is capable of doing.\n\nNow click the \"+ New API...\" link. This should toggle a new API form. In this form, enter a name (\"Sample API\") and upload the samples.json file you just downloaded.\n\nClick save.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f2pIoLdOR7iUiA7SM8j6_new-api.png\",\n        \"new-api.png\",\n        \"1435\",\n        \"597\",\n        \"#4c5c6a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## 5. Navigate into your new API\n\nYou should see a new \"Sample API\" listed in your APIs view. Go ahead and click that API.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/kdPHabIyTsGgkVYrX4Ii_sample-api.png\",\n        \"sample-api.png\",\n        \"1435\",\n        \"626\",\n        \"#6c86a2\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou should now see all of the Proxy Endpoints for the Sample API listed. There is a lot here. For now, we'll just focus on the first Proxy defined: \"A Hello World proxy\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/IZnXUuFDTJKRG31xwahC_api-overview.png\",\n        \"api-overview.png\",\n        \"1420\",\n        \"916\",\n        \"#699a5b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## 6. A Hello World proxy\n\nClick on \"A Hello World proxy\". You'll see the following:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/mCUBIKg0TDeQEOqZoFxW_hello-world.png\",\n        \"hello-world.png\",\n        \"1434\",\n        \"916\",\n        \"#6582a3\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nWhat you see is the following:\n- A name for your endpoint.\n- Whether or not your endpoint is currently 'active'. In other words, is it accessible to the outside world yet.\n- CORS enablement. This relates to Cross-Origin-Resource-Sharing. If this is turned on this endpoint can be accessed by Javascript running on other websites.\n- A simple description.\n- The environment this endpoint is currently using.\n- The group with which this endpoint has been associated.\n\nand most importantly for this guide:\n- **Routes**. You can see \"/helloworld\" with 'GET' checked. This means an HTTP GET request to your API at \"/helloworld\" should trigger *this* very endpoint.\n\n## 7. What does my Hello World proxy do?\n\nGood question! Not much right now. But this is the Quick Start Guide, right? Anyway, let's go find out.\n\nClick the following 'Logic Component' link on the current \"Hello World proxy workflow\" screen:\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/EwXSeeY9Q5OgKlzaWV6p_logic-component.png\",\n        \"logic-component.png\",\n        \"89\",\n        \"78\",\n        \"#4c6484\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou should then see an 'Edit Logic' component screen.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/tca1AzmuQSyOlzpkT7xL_hello-again.png\",\n        \"hello-again.png\",\n        \"1434\",\n        \"926\",\n        \"#5d87b7\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou can see here that we aren't actually doing much for this endpoint. The endpoint accepts the incoming request and then just slaps \"Hello world! Your nanoscale.io instance is running correctly.\" into the body of the response. This is a pretty superficial use case, but it gets the point across. Other Proxy Endpoints in the Sample API go into more depth on what you can actually do in these Javascript code blocks. Of course, the [Proxy Endpoints](doc:proxy-endpoints) docs also help.\n\n## 8. How do I actually hit my endpoints?\n\nGlad you asked! You see the blue rectangular box at the top left hand side of the screen? That is the default base URL for your API.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/zwPXUFReSvaBXAmFmJpN_host.png\",\n        \"host.png\",\n        \"705\",\n        \"175\",\n        \"#5086c5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThis blue box will show the first 'Host' for your current API. When you create a new API, you will get one publicly available host added by default. Visiting the 'Hosts' link on the left will bring you to the list of all hosts on this API.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/l1sDNPNMTBmebTkzbxaO_hosts.png\",\n        \"hosts.png\",\n        \"1434\",\n        \"438\",\n        \"#566974\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe host listed above is just one that we setup for this guide, however, your default host should look pretty similar. It will always be along the lines of: word-word-number.nanoscaleapi.io.\n\nThese hosts are available via http and https.\n\nRemember when we looked at the 'Routes' under each Proxy Endpoint? Now is when that matters. You'll append the route you want to access to your host. For the host you see above, that link is <a target=\"_blank\" href=\"https://organic-apparel-7319.justapis.io/helloworld\">here</a>.\n\nYour's should be accessible too. Go ahead and try it out by typing it into your browser's navigation bar. You should see the following.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/fbbccfe-HelloWorld.png\",\n        \"HelloWorld.png\",\n        498,\n        81,\n        \"#e9e9e6\"\n      ],\n      \"caption\": \"\"\n    }\n  ]\n}\n[/block]\n## You are now ready to build your own APIs!\n\n## Okay, but...now what?\n\n1. Read through the 'Getting Started' section to learn about [Terminology](doc:terminology), [API Creation Workflow](doc:api-creation-workflow), and the [Request/Response Lifecycle](doc:request-response-lifecycle).\n2. Read through the 'Reference' section to learn about [Proxy Endpoints](doc:proxy-endpoints) and [Remote Endpoints](doc:remote-endpoints). These are the building blocks of any API within nanoscale.io.\n3. Learn how to add logic to your endpoints and integrate to [Remote Endpoints](doc:remote-endpoints) like HTTP, SOAP, MySQL, Postgres, MS SQL Server, and MongoDB with JavaScript in the [JavaScript Object Reference](doc:javascript-object-reference-guide).\n3. Work through some of the more complex examples in the Sample API like the [Multiple Remote Endpoints in Sequence](doc:multiple-remote-endpoints-in-sequence) How To.","excerpt":"","slug":"quick-start-guide","type":"basic","title":"Quick Start Guide"}
This guide will step you through the process of getting started with nanoscale.io - from registration, to initial setup, to importing and running a sample Hello World API Endpoint. ## 1. Register at nanoscale.io for your free account! If you have not yet done so, go <a target="_blank" href="https://dashboard.nanoscale.io/#/registration">register for a free account on nanoscale.io</a>. You'll receive a confirmation email. Be sure to open it and click the confirmation link. If you don't do this, you won't be able to get into your account. ## 2. Open the nanoscale.io Dashboard Launch the <a target="_blank" href="https://dashboard.nanoscale.io/">nanoscale.io Dashboard</a> and login to your main account page. ## 3. Navigate to the Define APIs page Click on the <a target="_blank" href="https://dashboard.nanoscale.io/#/apis">Define APIs</a> circle on the far left. ## 4. Define your very first API First, go <a target="_blank" href="http://downloads.nanoscale.io/latest/samples.json">download the Sample API</a> that we've built. This API demonstrates a lot of what nanoscale.io is capable of doing. Now click the "+ New API..." link. This should toggle a new API form. In this form, enter a name ("Sample API") and upload the samples.json file you just downloaded. Click save. [block:image] { "images": [ { "image": [ "https://files.readme.io/f2pIoLdOR7iUiA7SM8j6_new-api.png", "new-api.png", "1435", "597", "#4c5c6a", "" ] } ] } [/block] ## 5. Navigate into your new API You should see a new "Sample API" listed in your APIs view. Go ahead and click that API. [block:image] { "images": [ { "image": [ "https://files.readme.io/kdPHabIyTsGgkVYrX4Ii_sample-api.png", "sample-api.png", "1435", "626", "#6c86a2", "" ] } ] } [/block] You should now see all of the Proxy Endpoints for the Sample API listed. There is a lot here. For now, we'll just focus on the first Proxy defined: "A Hello World proxy". [block:image] { "images": [ { "image": [ "https://files.readme.io/IZnXUuFDTJKRG31xwahC_api-overview.png", "api-overview.png", "1420", "916", "#699a5b", "" ] } ] } [/block] ## 6. A Hello World proxy Click on "A Hello World proxy". You'll see the following: [block:image] { "images": [ { "image": [ "https://files.readme.io/mCUBIKg0TDeQEOqZoFxW_hello-world.png", "hello-world.png", "1434", "916", "#6582a3", "" ] } ] } [/block] What you see is the following: - A name for your endpoint. - Whether or not your endpoint is currently 'active'. In other words, is it accessible to the outside world yet. - CORS enablement. This relates to Cross-Origin-Resource-Sharing. If this is turned on this endpoint can be accessed by Javascript running on other websites. - A simple description. - The environment this endpoint is currently using. - The group with which this endpoint has been associated. and most importantly for this guide: - **Routes**. You can see "/helloworld" with 'GET' checked. This means an HTTP GET request to your API at "/helloworld" should trigger *this* very endpoint. ## 7. What does my Hello World proxy do? Good question! Not much right now. But this is the Quick Start Guide, right? Anyway, let's go find out. Click the following 'Logic Component' link on the current "Hello World proxy workflow" screen: [block:image] { "images": [ { "image": [ "https://files.readme.io/EwXSeeY9Q5OgKlzaWV6p_logic-component.png", "logic-component.png", "89", "78", "#4c6484", "" ] } ] } [/block] You should then see an 'Edit Logic' component screen. [block:image] { "images": [ { "image": [ "https://files.readme.io/tca1AzmuQSyOlzpkT7xL_hello-again.png", "hello-again.png", "1434", "926", "#5d87b7", "" ] } ] } [/block] You can see here that we aren't actually doing much for this endpoint. The endpoint accepts the incoming request and then just slaps "Hello world! Your nanoscale.io instance is running correctly." into the body of the response. This is a pretty superficial use case, but it gets the point across. Other Proxy Endpoints in the Sample API go into more depth on what you can actually do in these Javascript code blocks. Of course, the [Proxy Endpoints](doc:proxy-endpoints) docs also help. ## 8. How do I actually hit my endpoints? Glad you asked! You see the blue rectangular box at the top left hand side of the screen? That is the default base URL for your API. [block:image] { "images": [ { "image": [ "https://files.readme.io/zwPXUFReSvaBXAmFmJpN_host.png", "host.png", "705", "175", "#5086c5", "" ] } ] } [/block] This blue box will show the first 'Host' for your current API. When you create a new API, you will get one publicly available host added by default. Visiting the 'Hosts' link on the left will bring you to the list of all hosts on this API. [block:image] { "images": [ { "image": [ "https://files.readme.io/l1sDNPNMTBmebTkzbxaO_hosts.png", "hosts.png", "1434", "438", "#566974", "" ] } ] } [/block] The host listed above is just one that we setup for this guide, however, your default host should look pretty similar. It will always be along the lines of: word-word-number.nanoscaleapi.io. These hosts are available via http and https. Remember when we looked at the 'Routes' under each Proxy Endpoint? Now is when that matters. You'll append the route you want to access to your host. For the host you see above, that link is <a target="_blank" href="https://organic-apparel-7319.justapis.io/helloworld">here</a>. Your's should be accessible too. Go ahead and try it out by typing it into your browser's navigation bar. You should see the following. [block:image] { "images": [ { "image": [ "https://files.readme.io/fbbccfe-HelloWorld.png", "HelloWorld.png", 498, 81, "#e9e9e6" ], "caption": "" } ] } [/block] ## You are now ready to build your own APIs! ## Okay, but...now what? 1. Read through the 'Getting Started' section to learn about [Terminology](doc:terminology), [API Creation Workflow](doc:api-creation-workflow), and the [Request/Response Lifecycle](doc:request-response-lifecycle). 2. Read through the 'Reference' section to learn about [Proxy Endpoints](doc:proxy-endpoints) and [Remote Endpoints](doc:remote-endpoints). These are the building blocks of any API within nanoscale.io. 3. Learn how to add logic to your endpoints and integrate to [Remote Endpoints](doc:remote-endpoints) like HTTP, SOAP, MySQL, Postgres, MS SQL Server, and MongoDB with JavaScript in the [JavaScript Object Reference](doc:javascript-object-reference-guide). 3. Work through some of the more complex examples in the Sample API like the [Multiple Remote Endpoints in Sequence](doc:multiple-remote-endpoints-in-sequence) How To.