Before You Begin
This 10-minute tutorial shows you how to create a basic Node.js application on Oracle Application Container Cloud Service.
Background
Oracle Application Container Cloud Service lets you deploy Java SE, Node.js, PHP, and Python applications to the Oracle Cloud.
What Do You Need?
Access to an instance of Oracle Application Container Cloud Service
Create a Node.js Application
-
Create the
myapp.js
file in your local system and add the following content:var http = require('http'); // Read Environment Parameters var port = Number(process.env.PORT || 8080); var greeting = process.env.GREETING || 'Hello World!'; var server = http.createServer(function (request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.end(greeting + "\n"); }); server.listen(port);
- Create the
manifest.json
file and add the following content:{ "runtime":{ "majorVersion":"6" }, "command": "node myapp.js", "release": {}, "notes": "Hello World application" }
- Open a command-line window and go to your project directory.
- Compress both the
myapp.js
andmanifest.json
files together in a.zip
file:zip getting-started-node-accs.zip myapp.js manifest.json
Deploy Your Application to Oracle Application Container Cloud
- Log in to Oracle Cloud at http://cloud.oracle.com/. Enter your account credentials in the Identity Domain, User Name, and Password fields.
- In the Oracle Cloud Services dashboard, click the Action menu
, and select Oracle Application Container Cloud Service.
- To open the Oracle Application Container Cloud Service console, click Services.
- In the Applications list view, click Create Application and select Node.
- In the Application section, enter a name for your application and click Browse.
- On the File Upload dialog box, select the
getting-started-node-accs.zip
file you created in the previous section and click Open. - Keep the default values in the Instances and Memory fields and click Create.
- Wait until the application is created. The URL is enabled when the creation is completed.
- Click the URL of your application.
Description of the illustration node-app-response.png
Want to Learn More?
- Building and deploying Node.js applications to Oracle Application Container Cloud Service Learning Series
- Oracle Application Container Cloud Service in the Oracle Help Center