Menu

Dogukan Demir

Language Agnostic Software Engineer

Trakya University Summit of IT and Innovation ’17

We were guest of Trakya University Computer and Innovation Club with Anıl Reis and Dilek Coşkun from Hepsiburada team on April 26, 2017. We were welcomed very warmly by the teachers and students when we had a long journey with nature. Murat Topaloğlu, the head of the department, mentioned about their curriculum in a place with a very nice view in the sponsorship of Coffee Table. Although I thought that their curriculum is so hard for undergraduate students, when I find the opportunity to chat with students, it is clear that the students are prepared nicely for the real life.

We gave Hepsiburada gift voucher to 5 students who answers our questions correctly during our presentation. We gave information about our working environment, the technologies and methodologies we use, and tried to answer questions that comes from students. After the presentation, we had the opportunity to visit the stands of some graduation projects. As an old Microsoft Student Partner Leader I found the opportunity to meet Derya Kendirci who is MSP of Trakya University. I wish good luck to her and her team in Microsoft Imagine Cup competition.

I would like to thank Murat Topaloglu, Duygu Solak, Egement Tekkanat, Furkan Akbaş and all the students who organized this event.

Node.js Hello World Application

After connecting your Windows server click "Node.js command prompt" under Node.js folder in Start menu. If you didn't install Node.js, you can install it by reading How to Install Node.js on Windows Server? post and then you can run "Node.js command prompt".

In "Node.js command prompt" screen, you can create your first application with the following commands. So what are the meanings of these commands?

Node.js Hello World

For those who do not know how to use command prompt, I want to explain 2 commands I use on the screen, regardless of the Node.js command prompt.

cd: change directory

mkdir: make directory

"cd C:\" command will change your current directory to main directory of C driver. "mkdir nodejs" command will create a new folder inside current folder.

Once you have created the C:\nodejs\helloworld directory and go to this directory, you can run the npm package builder to create a new Node.js application using the command "npm init". Package builder will ask you some informations respectively name, version, description, entry point, test command, git repository, keywords, author and license. You can create your application with default values (values inside paranthesis) with pressing enter key. I just change description and author fields. Once you have completed the information, you can create your application by checking the preview of your package.json file and pressing the enter key.

"echo console.log("hello world"); > index.js" command will create a file named index.js inside your current directory and writes "console.log("hello world");" into index.js file. The index.js value in this command must be the same as the entry point value. Finally, when you run your application with the "node index" command, you will see "hello world" text which you print it on the screen with "console.log" code line.

Congratulations, you have run your first application after installing Node.js in your Windows server on AWS. Next blog post will be about how to access this application from outside of the server via browser.

How to Install Node.js on Windows Server?

After connected to your Windows Server on AWS, you can download latest Node.js version from https://nodejs.org with the help of Internet Explorer. If you don't know how to connect your Windows server, you can connect it by reading my Connect to Windows Server on AWS post.

node.js Download

Run setup file and complete setup.

Node.js Setup Steps

Congratulations. You have successfully install Node.js on your server.

Node.js Command Prompt

Next post will be about writing a hello world application runs on Node.js.

Connect to Windows Server on AWS

If you don't create a Windows Server on AWS, you can create it by reading my Create a Free Windows Server on AWS post. If you have created your server, click "Connect" button after selecting server which named "Windows Server 2016" under "Instances" page.

Connect

In "Connect To Your Instance" panel after clicking "Download Remote Desktop File" button to download .rdp file, click "Get Password" button to get "Administrator" password.

Connect To Your Instance

In this step, we need key-pair file which we created in previous blog post. My key-pair file name is "Windows2016Server.pem", that's why it asks us to choose Windows2016Server.pem file. After file selection, click "Decrypt Password" button.

Decrypt Password

You can see password of your "Administrator" user.

Username Password

When you open .rdp file which we just downloaded, click "Connect" button to bypass that warning. Copy password which you see in "Password" section, paste it as password of your "Administrator" user and click "OK" button. You can bypass warning about certificate by clicking "Yes" button.

Enter Your Credentials

When you connect to your server, you can see details of your server in upper right corner of the screen.

Server Details

Congratulations. You have successfully connected to your Windows server. Next blog post will be about how to install node.js to this server.

Create a Free Windows Server on AWS

If you don't have an AWS account, you can create it by reading my Create an AWS Account post. If you create your account, login to your account, go to https://console.aws.amazon.com address and select EC2 under Services.

Services EC2

Click "Launch Instance" button under Create Instance panel.

Launch Instance

In this step choose operating system of your server. In this post we will continue by creating a Windows server. To do this click "Select" button next to "Microsoft Windows Server 2016 Base".

Microsoft Windows Server 2016 Base

Once you have selected t2.micro as our server type, click "Next: Configure Instance Details" button.

Instance Type

You can click "Next" button without making any changes in "Configure Instance", "Add Storage" and "Add Tags" steps.

Note: You can make changes to the settings in these steps, but you should not exceed your needs when making your selections. Otherwise, your credit card may be charged.

We will make some changes in "Configure Security Group" step. To provide RDP, HTTP and HTTPS access to our server, we need to add these rules (RDP attached by default) first. In addition, you can add 8080 and 3000 ports to use for development. If you want to access your server from anywhere, you need to select "Anywhere" as "Source" property. If you want to restrict access, you can enter IP address by CIDR (Classless Inter-Domain Routing) notation after selecting "Custom" or "My IP". After you have done your settings, click "Review and Launch" button.

Configure Security Group

In the last step, click "Launch" button after review your server properties.

Launch Instance

In order to connect to the server, you need to have a key pair file. To create a key pair file click "Create a new key pair", give a name in "Key pair name" field and click "Download Key Pair" button. Key pair dosyasını oluşturmak için "Create a new key pair" seçip "Key pair name" alanına istediğiniz bir isim verdikten sonra "Download Key Pair" butonuna tıklayarak dosyayı indirmeniz gerekiyor. After download of your file, click the "Launch Instances" button.

Note: You need to save key pair file where you have access and you should not lose your key pair file. You can download this file only the first time you create it. There is no panel you can download later.

Create a new key pair

Your server is in preparation phase. Click the "View Instances" button to see status of your server.

View Instance

It takes a few minutes to be ready. You can see the state of your server in "Instance State" field.

Instance State

You can give a name to your server to easily find it when you have lots of servers. When you hover "Name" field, there will be a pencil icon. Click pencil icon and give a name to your server.

Edit NameName Edit

Congratulations. You successfully created a Windows server. Next blog post will be about how to connect this server remotely.

Create an AWS Account

To create an AWS (Amazon Web Services) account, you need to open https://aws.amazon.com and click "Create an AWS Account" button.

Create an AWS Account

Type your e-mail, select "I am a new user" and click "Sign in using our secure server" button.

Sign In or Create an AWS Account

Type your name, e-mail again, password and click "Create account" button.

Login Credentials

There are two types of account which are Company Account and Personal Account. Choose your account type and then fill the form. When the form is complete click "Create Account and Continue" button.

Contact Information

In this step you need to enter your credit card information. As long as you use free-tier services, Amazon doesn't charge anything from your credit card.

Note: Amazon doesn't charge anything from your credit card in this step.

Payment Information

In Identity Verification step, you need to enter your phone number and click "Call Me Now" button.

Identity Verification

After clicking "Call Me Now" button Amazon will call you and asks 4 digit pin number which is in the Call in progress panel. You can enter or say these digits while you are in a call with Amazon.

Call In Progress

After you successfully enter 4 digits pin number, second step will finish automatically and third step appears. In this step click "Continue to select your Support plan" button.

Identity Verification Complete

In this post I choose "Basic" plan for free services but according to your needs you can choose other support plans. After choosing your support plan, click "Continue" button.

Note: You can change your support plan later.

Support Plan Panel

Click "Complete Sign Up" button and login with your credentials.

Complete Sign Up

Congratulations. You create your AWS account successfully. Next blog posts I will write about how to use AWS services.