Getting Started with Oracle Application Container Cloud Service

Tweet about this on TwitterShare on Facebook0Share on LinkedIn24Share on Google+0

Currently, many companies and developers do not want to worry or waste time supporting complex environments.
PaaS services are a great way to abstract this work, making developers concerned only with the design and the code they need to develop.
Oracle Application Container Cloud Service (ACCS) allows you to deploy Java SE, Node.js, PHP, Python, and Ruby applications to the Oracle Cloud.
In this post, we’ll look at how easy it is to build a NodeJS application and deploy it to ACCS.

Download the sample application: accsnodejs.zip.

First of all, let’s create the NodeJS application.
Create a folder and name it as “accsnodejs”.
Inside the accsnodejs folder, create a file, name it as “app.js” and paste the following code into it.

var express = require('express');
var app = express();

app.get("/", function(req, res) {
  res.send("<html><h1>App NodeJS running!!</h1></html>");
});

app.listen(8089, function() {
  console.log("NodeJS Server Running!");
});

To create the package.json file, open a terminal and run the following command inside the accsnodejs folder.

npm init

When you upload your application to ACCS using the user interface, you must include a file called manifest.json if your application requires a launch command.
Then, create this file and paste the following code into it.

{
  "runtime":{"majorVersion" : "6"},
  "command":"node app.js",
  "release" : {},
  "notes":""
}

Since we are using the Express module in the app.js file, we need to download it.
Run the following command inside the accsnodejs folder.

npm install express --save

Finally, create a zip file of your files.

Done!
Now that our application has completed, go to ACCS to deploy the application.
Click the Create Application button, and then click the Node button.

Name the application as “accsnodejs”, click the browse button near Archive label and select the application zip file.

Wait for your application to be created and click the URL link.

The application is running!
Enjoy and improve it!

Tweet about this on TwitterShare on Facebook0Share on LinkedIn24Share on Google+0

Author: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.

Leave a Reply

Your email address will not be published. Required fields are marked *