GithubHelp home page GithubHelp logo

chefi's Introduction

chefi

Overview

Clone of fiche in Rust.

Tested and working in Linux and Windows (likely macOS as well).

chefi is an application that starts a TCP and HTTP server. A user can post a "paste" to the service with only netcat and then receives a short URL which can then be used to retrieve the paste contents on another machine.

$ cargo run
Jan 04 23:09:02.303 INFO listening for pastes, port: 9999
Jan 04 23:09:02.303 INFO serving pastes, port: 9090, dir: /tmp/chefi/data

# (you'll need to open another terminal)

$ echo 'This is a test!' | nc localhost 9999
http://localhost:9090/OJhK5

$ curl http://localhost:9090/OJhK5
This is a test!

This is partially meant as a learning exercise and as a way to demostrate some features/libaries in Rust:

  • async IO (future-rs and tokio)
  • human-parseable error-backtraces (error_chain)
  • structured logging (slog)
  • painless CLI argument parsing (clap.rs)
  • http static file serving (iron.rs)

Status

Mostly working (albeit with some hacks).

Notes:

  1. Please grep through the source for TODOs. There are a few places where some hacks have been used. (For example, the directory for persisting pastes is derived from the command line flag properly, but the http serving directory is hard coded).
  2. This builds on stable rust, though the ./build/build.sh script uses clippy and ensures that the nightly toolchain is updated and available as well.

Thanks

Huge thanks to 24 days of Rust.

I can't emphasize enough what a fantastic resource this is. Real patterns for building real apps in Rust with great examples and links for further reading and more elaborate examples. Thanks @zsiciar (twitter/github)!

chefi's People

Contributors

colemickens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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