Giter Club home page Giter Club logo

colon-files's Introduction

colon-files

Simple app in Sinatra to receive and send files to university project's subsystems.

Installing

First you should have MySQL server running, with database colon. Inside you should create two tables:

tasks
  id:integer
  in_file_path:string
  out_file_path:string

solutions
  id:integer
  file_path:string

This app does not create records, so to attach any file you first need to create sample rows yourself. Then:

  1. git clone https://github.com/sjchmiela/colon-files.git
  2. cd colon-files
  3. bundle install
  4. Edit database connection settings in config.yml.
  5. ruby app.rb
  6. Open browser, head over to http://localhost:4567/.

API

Solutions

Attaching solutions

POST /solutions/:solution_id — attach file solution_file to solution with id solution_id. Expects solution_file parameter with file attached. Solution with specified solution_id should already be persisted in database. Returns JSON: {success:boolean, message:text}.

Retrieving solution

GET /solutions/:solution_id — retrieve file solution_id.

Tasks

Attaching task files

POST /tasks/:task_id — attach files task_in_file and task_out_file to task with id task_id. Expects parameters task_in_file and task_out_file as files. Task with specified task_id should already be persisted in database. Returns JSON: {success:boolean, message:text}.

Retrieving task files

GET /tasks/:task_id/in — retrieve infile of task with id task_id.

GET /tasks/:task_id/out — retrieve outfile of task with id task_id.

`GET /tasks/:task_id/in` — retrieve infile of task with id `task_id`.

`GET /tasks/:task_id/out` — retrieve outfile of task with id `task_id`.

Testing

Testing web interface is at http://localhost:4567/ of the app.

colon-files's People

Contributors

sjchmiela avatar

Watchers

 avatar  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.