TGIMBA NodeJS – Part 1

Git Hub Code

NOTE: The API Git repository got scrambled and I had to start over.  The link above is correct.

Due to some changes as work, I am refocusing my energy on NodeJs. To learn this technology, I am going to create an API for The Globe In My Application (TGIMBA) using NodeJS. My hope is that I will have a complete replacement for the existing .NET Web API and WCF services it currently uses. A quick google search revealed a number of tutorials. I ended up choosing one (see reference #2) that walked me through how to locally setup a NodeJS API that also served up pages.

landingpagelocal

Next, I had to get it out to the web. As I have stated earlier, I love Amazon because how easy their tools are to use. I looked up NodeJS on Amazon’s Elastic Beanstock (their Http service) and I was rewarded with simple instructions and sample projects in NodeJs (see reference #1). There are three sample projects that they provide. Since I have heard so much about express and the tutorial (reference #2) showed how easy it was, I tried using the second AWS template that has express. However, I was not able to get that to work. I downloaded the sample application code that was created as part of the web server I created on AWS and it turns out it is the first type. So, this blog post will deal with that type. Working through the tutorial, I was able to modify the files to have a basic set of routes to be place holders for the existing .NET API.

I deployed the updated code to AWS and was able to get it returning expected place holder string for each route.

landingpageaws

upsertbucketlistitemaws

processuserregistrationaws

processuseraws

getbucketlistitemsaws

deletebucketlistitemaws

apicheckaws

My next blog post will deal with getting express working and having my routes look more like they did using the school.scotch.io tutorial. Posts after that will deal with security and adding SQL queries to pull the existing system data.

Stay tuned!

References

1) http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.html
2) https://school.scotch.io/build-a-nodejs-website
3) http://stackoverflow.com/questions/17251553/node-js-request-object-documentation

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s