Coder Social home page Coder Social logo

httpc's Introduction

httpc workflow

httpc

Minimal CLI application using TCP sockets to send HTTP requests.


COMP 445


Concordia University

Computer Networking

Lab assignment 1

Winter 2022


This CLI application is built as a submission to the COMP445 course at Concordia University.

Here are the expected arguments and options this CLI application expects:

$ httpc (get|post) [-v] (-h "k:v")* [-d inline-data] [-f file] URL



Installation


Clone this repository and install its dependencies.

  $ yarn install

Running the app locally

To be able to run this locally, you need to have installed Node.js 14 or later.


You must build the executable first. Transpile the Typescript code into Javascript with:

  $ yarn build

You can then run the CLI application locally using the Javascript executable file in the dist folder. For example:

  $ node dist/src/httpc.js get https://httpbin.org/get


Using Docker ๐Ÿณ

First, build the docker image for the executable using the Dockerfile provided.

  $ docker build -t httpc .

Next, run the docker image while passing specified CLI arguments. For example:

  $ docker run httpc get https://httpbin.org/get

By executing the CLI application as presented above can yield leftover unused docker containers. You can prevent this by appending the --rm option. For example:

  $ docker run --rm httpc get https://httpbin.org/get



Unit Tests


Modules in this assignment are also covered as units of code.

$ yarn test

You can check the coverage with

$ yarn test:cov

httpc's People

Contributors

qjimmy avatar njlprograms avatar dependabot[bot] 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.