Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 2.31 KB

README.md

File metadata and controls

76 lines (56 loc) · 2.31 KB

Chimera

CGI with Ruby and JSON.

Architecture

The main idea is to expose any kind of code inside the registry folder to the web. The request object (parameters, etc.) is serialized to JSON and passed as environment variable to non-ruby binaries/scripts.

There is no kind of sandboxing implemented (and probably never will be).

Never run this as root user in production!

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Please see the requirements.txt for dependencies.

Installing

Clone the repository:

git clone https://github.com/doomguy/chimera

Run Chimera:

ruby chimera.rb

Interact with it:

curl localhost:4567/helloRuby
Hello, World!
This is Ruby!

curl localhost:4567/helloRuby?name=FooBar
Hello, FooBar!
This is Ruby!

curl localhost:4567/helloPython
Hello, World!
This is Python!

curl localhost:4567/helloPython?name=FooBar
Hello, FooBar!
This is Python!

Please note: Examples for other languages may need some more work to run. See the README.md in the respective example folder.

Usage

For new scripts follow these simple steps:

  1. Create a new folder under registry (CamelCase recommended).
  2. For native ruby code, just have a look at the helloRuby example.
  3. For non-ruby code, copy the helper.rb into the folder and rename it to the folder name. By default GET and POST is supported.
  4. Put your binary/script with the name main into the folder. Make it executable (chmod +x main)!
  5. (Re)Start Chimera

Built With

Contributing

Just send in your pull request if you feel like it.

Versioning

SemVer is used for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Unlicense - see the LICENSE file for details.

Acknowledgments

  • Hat tip to anyone whose code was used!
  • Inspired by OpenLambda