Developer Documentation
  • Documentation Overview
  • Development Introduction
  • Getting Started
  • Fundamentals
    • Deploy an App via Pre-defined Sidecar
      • Sidecar Tutorial: Server-side
      • Sidecar Tutorial: Client-side
      • Sidecar Tutorial: Docker & Deploy
    • Deploy an App with Eureka
    • Design Guidance
  • Authentication
    • Accessing data exposed by the platform
    • Single Sign-On
      • Angular
      • Vue
      • Java Spring: Accepting JWT
      • Python Django: Accepting JWT
    • User and Role Identification
  • APIs | Data Integration
    • Submodel Index
    • Masterdata
    • Transactional data
  • Docker Information
    • Ruby Stack
    • Golang Stack
    • Node JS Stack
    • Java Spring Stack
    • Python Stack
  • Connect to the Platform
    • Integrate using Eureka Rest APIs
    • Use our Pre-built sidecar
    • Production deployment
  • Add-on Features
    • IApps-Navigation
  • Testing
  • FAQs | Troubleshooting
  • Registration
    • Application pre-requisites
      • Basic Requirements
    • Register Developer Account
    • Submit basic application info
    • Onboard Application
      • Submit Appstore details
        • App basic information
      • Configure Application
        • App Permission
        • App Data
        • AAS Instance
        • Licensing
        • Access Rights
        • Account Info
        • Terms Of Use
        • Pricing
      • Publish and test
        • Deploy
        • Register into Service Discovery
    • Publish to Marketplace
  • User Experience
  • The business model - How do I get paid?
  • References
    • IndustryApps - Intro
    • What is an Asset Administration Shell?
    • What is ECLASS?
      • How is ECLASS and Concept dictionary are used
    • Industry 4.0 standards
    • Customer Terms of Use
      • Subscription Order
    • Solution provider Terms of Use
      • Contract regions
      • Submission Form ( Solution provider)
Powered by GitBook
On this page
  • How to develop an application
  • # Step 1 Creating node application
  • # Step 2 Implementing basic requirements
  • # Step 3 Packing as Docker image
  • # Step 4 Access platform with credentials
  1. Fundamentals

Deploy an App with Eureka

Build an App under 5 minutes.

PreviousSidecar Tutorial: Docker & DeployNextDesign Guidance

Last updated 2 years ago

This guide helps you in creating your first application with IndustryApps AppStore.

Before creating the application you need to complete the registration step as explained under .

How to develop an application

The application tutorial here is only to provide you a quick approach to create a simple hello world application using Eureka and view it inside IndustryApps. It would give you a quick understanding on the business model by utilising the Eureka Service Discovery.

# Step 1 Creating node application

npm init -y

# Step 2 Implementing basic requirements

# Step 2.1 Adding Dependencies

npm install eureka-js-client express nodemon --save

  • eureka-js-client to implement registry sync

  • express as application server

  • nodemon to react with changes without reloading

# Step 2.2 Creating basic server and implementing application registry sync

'use strict';

const express = require('express');
const Eureka = require('eureka-js-client').Eureka;
const APPLICATION_CODE = process.env.APPLICATION_CODE;
const APP_REGISTRY_HOST = process.env.APP_REGISTRY_HOST;
const APP_REGISTRY_PORT = process.env.APP_REGISTRY_PORT;
const APP_HOST = process.env.APP_HOST;
const APP_PORT = process.env.APP_PORT;
const app = express();

// example configuration
const client = new Eureka({
    // application instance information
    instance: {
        app: `${APPLICATION_CODE}`,
        hostName: APP_HOST,
        ipAddr: APP_HOST,
        statusPageUrl: `http://${APP_HOST}:${APP_PORT}`,
        vipAddress: `${APPLICATION_CODE}`,
        port: {
            $: APP_PORT,
            '@enabled': 'true',
        },
        dataCenterInfo: {
            '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo',
            name: 'MyOwn',
        },
        registerWithEureka: true,
        fetchRegistry: true,
    },
    eureka: {
        // eureka server host / port
        host: APP_REGISTRY_HOST,
        port: APP_REGISTRY_PORT,
        servicePath: '/eureka/apps/',
    },
});


client.logger.level('debug');
client.start(error => {
    console.log(error || 'NodeJS Started!');
    app.get('/', (req, res) => {
        res.sendFile(__dirname + '/index.html', err => console.log);
    });
});

app.listen(APP_PORT, APP_HOST);
console.log(`Running on http://${APP_HOST}:${APP_PORT}`);

# Step 2.3 Adding theming and basic components

<html>
<head>
    <title>Sample App</title>
    <link href="/dam/public/iapp-ui-styles/v.1.0.0/main.css">
    <script src="/dam/public/iapp-generics/v.1.0.1/iapp-generics.js"></script>
</head>
<body>
    <iapps-require-module>
        <iapps-module name="basic"></iapps-module>
    </iapps-require-module>
    <iapps-header-sidebar></iapps-header-sidebar>
    <div class="content-area bg-grey">
        <h1>Hello from sample app</h1>
    </div>
</body>
</html>

Following urls /dam/public/iapp-ui-styles/v.1.0.0/main.css and/dam/public/iapp-generics/v.1.0.1/iapp-generics.js will be resolved when you access the application via local gateway.

# Step 3 Packing as Docker image

FROM node:carbon

# create the app directory for inside the Docker image
WORKDIR /usr/src/app

# install app dependencies from the package.json (and the package-lock.json)
COPY package*.json ./

RUN npm install

# bundle app source inside Docker image
COPY . .

# expose port 8080 to have it mapped by Docker daemon
EXPOSE 8080

# define the command to run the app (it's the npm start script from the package.json)
# npm start
CMD [ "npm", "start" ]

# Step 4 Access platform with credentials

When accessing the URL of the platform provided by the team you will find a screen like below.

When clicking on the menu item

you will be redirected to your app. Screenshot based on above snippet is given below.

Register developer account