exampleblog

by munew

GitHub Readme.md

exampleblog-node

This is the docker image of Example Blog website Analyst Service nodejs implement

Configuration

Environment Variables

  1. MUNEW_BASE_URL: Required. URL to your Munew Engine UI.

    If you are running on local, don't use localhost, use host IP address. For example: 10.0.0.247

  2. GLOBAL_ID: Required. Analyst Service Global ID you registered inside Munew app. If you don't know how to get Analyst Service Global ID, please read Get an Analyst Service Global ID
  3. INIT_TASKS_NUMBER: Optional. How many tasks for each trigger call you want. Default is 1, this variable is useful for test purpose
  4. PORT: Optional. Port number for this example server. Default value is 3000, when you run it in docker mode, you can map host port to 3000

Local

If you want to run it local, make sure you already installed NodeJS and Yarn.

  1. Install node_modules. yarn install
  2. Start server
    export MUNEW_BASE_URL=http://10.0.0.247:9199 && \
    export GLOBAL_ID=c29pOjoxNTkzNDEyMzA0MTM5OjphMDZmZTk2My02OTc4LTQ5NTUtOGQyOC00ZTliNjFlNjAzYzk= && \
    npm start
    
    It start a server on local, you can access it http://localhost:3000

You also can change PORT or INIT_TASKS_NUMBER

Docker

munew/exampleblog-node

Usage

docker run -e MUNEW_BASE_URL=http://10.0.0.247:9099 \
           -e GLOBAL_ID=c29pOjoxNTgyMzM2NDc1NzE2OjphMzkyOWUwYS0yMDUzLTRhNTktOTBiYy00ZDQwMjgyNzRhZmY= \
           -p 3000:3000 munew/exampleblog-node:v0.1.1

Every trigger call will add 10 tasks

docker run -e MUNEW_BASE_URL=http://10.0.0.247:9099 \
           -e GLOBAL_ID=c29pOjoxNTgyMzM2NDc1NzE2OjphMzkyOWUwYS0yMDUzLTRhNTktOTBiYy00ZDQwMjgyNzRhZmY= \
           -e INIT_TASKS_NUMBER=10 \
           -p 3000:3000 munew/exampleblog-node:v0.1.1

Don't forget to change the tag value

Heroku

You can simply deploy this example to Heroku by click this button: Deploy