Giter Site home page Giter Site logo

renuo / rust-sinatra-heroku-experiment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukaselmer/rust-sinatra-heroku-experiment

0.0 3.0 0.0 1.71 MB

Using Rust in Ruby, Deployed to Heroku Using Sinatra

Home Page: https://rocky-headland-3541.herokuapp.com/

Ruby 96.68% Rust 3.32%
r-lukaselmer

rust-sinatra-heroku-experiment's Introduction

Using Rust in Ruby, Deployed to Heroku Using Sinatra

Setup & Compilation

  • Install rust & cargo
  • Install bundler
rbenv install
bundle install
(cd calculator && cargo build --release)

Tests

rspec

Run Sinatra App

open 'http://localhost:4567'
ruby rustapp.rb

Compilation and Platforms

The shared library has to be compiled for your CPU architecture. On mac osx the Rust code is comiled to libcalculator.dylib and on linux it is compiled to libcalculator.so. It should compile to libcalculator.dll on Windows, but the ruby code will not work there unless you edit app/fast_calculator.rb.

Deployment

The app has been tested under mac osx and linux. It can be deployed directly to heroku:

  • Install the heroku toolbelt
heroku create
git push heroku master
heroku run rspec
heroku open

Remember to compile and commit libcalculator.so for linux before pushing to Heroku.

Demo

It may take a while for heroku to start the VM (e.g. 30 seconds). Be patient.

https://rocky-headland-3541.herokuapp.com/

rust-sinatra-heroku-experiment's People

Contributors

lukaselmer avatar

Watchers

James Cloos avatar Diego Steiner avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.