New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

atomable-runtime

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atomable-runtime

Runtime for atomable's serverless microservice framework.

  • 1.0.0-alpha.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by675%
Maintainers
2
Weekly downloads
 
Created
Source

atomable npm Build Status

atomable runtime

This is the runtime for the atomable serverless microservices framework. Our goal is to make your serverless life easier!

The best way to use this runtime is by using our insanely powerful atomable cli.

If using command line tools is not your thing, well we still got your covered! Check out the code examples below to get started!

Documentation

https://docs.atomable.io/

Source code | fork | pull request | issues

https://github.com/atomable/runtime

Installation

npm

npm install atomable-runtime

yarn

yarn add atomable-runtime

Importing

const runtime = require('atomable-runtime');

import { register, handle } from 'atomable-runtime';

Usage

To use the runtime you need to create an AWS lambda that will be the main entry point of your project. Once this is done, you never have to think about configuring more lambdas.

handler.js

const runtime = require('atomable-runtime');

/**
 * () registers the function and the
 * callback to handle the aws event
 */
(() => {
  const protonHandler = require('./proton/proton.js').proton;
  const protonConf = { name: 'proton', https: { path: 'proton', method: 'get', parameters: [{ in: 'query', name: 'firstName' }, { in: 'query', name: 'lastName', required: false }] }};
  runtime.register(protonHandler, protonConf);

  const electronHandler = require('./electron/electron.js').electron;
  const electronConf = { name: 'electron', https: { path: 'electron', method: 'post', parameters: [{ in: 'body', name: '*' }, { in: 'headers', name: 'authorization' }] }};
  runtime.register(electronHandler, electronConf);
})();


/**
 * handler() handles aws lambda events
 */
export const handler = runtime.handle;

proton.js

// firstName is guaranteed not to be null since it is required by default
// since we configured lastName to not be required, it may be undefined here
module.exports.proton = (firstName, lastName) {
  // you can also return a promise, we will handle the result correctly.
  return { statusCode : 200, body: `Hello ${firstName} ${lastName}` };
};

Tests

To run the tests, simply checkout the code and run npm test.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request!

If you find issues with the runtime, log them here in our issues.

If you feel like contributing, one thing you have to know is we hate classes, the keyword new and we like to use our Monad library, lift.js, as often as possible :)

Roadmap

Here is a list of things we want to do in this project, feel free to help us out!

  • Add parameter validators (stringNotEmpty, stringLength, intBetween, etc. That sort of thing...)
  • Better error messages when things are not configured as they should.
  • Support multiple cloud providers

License

MIT

FAQs

Package last updated on 08 Dec 2016

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc