Socket
Book a DemoInstallSign in
Socket

arc.app-example

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc.app-example

An example Arc application

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Arc Example App

Build Status Maintainability Test Coverage

  • This app demonstrates how to create a microservice, and add functionality with an extension using Arc.

Install

npm install arc.app-example

Microservice

/microservice/example/index.js

module.exports = () => {
  return `Hello, World!`;
};
  • A micoservice at it's most basic is just a node module.
  • If you want to know more about microservices, check the Arc wiki.

Microservice Configuration

/microservice/example/config.js

module.exports = {
  'Example': {
    protocol   : `example-protocol-name://`,
    resource   : `example`,
    description: `This is a basic microservice example`
  }
};
  • A microservice configuration is an object that has properties used for configuartions
  • If you want to know about how to configure a microservice, check the Arc wiki.

The Application

/index.js

const arc          = require(`arcms`);
const apiExtension = require(`arc.extension-api`);
const config       = require(`./microservice/example/config`);

// Add the API extension to Arc and set the API extension to run on port 8080
arc.addExtension(apiExtension, {
  port: 8080
});

// Arc configures and starts an example microservice
arc(config)
  .then(() => {
    console.log(`Arc Example Online`.bold.cyan);
  });
  • You can learn more about Arc extensions in the Arc wiki.
  • You can learn more about configuring microservices in the Arc wiki.

Start Redis

sudo service redis-server start

Run

npm start
  • View the API by visiting http://localhost:8080

Keywords

Arc

FAQs

Package last updated on 13 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.