Git Product home page Git Product logo

dat-gateway's Introduction

dat-gateway

Stability NPM Version JavaScript Style Guide Build Status

No longer maintained. Check out the https://github.com/garbados/dat-gateway fork instead.

A configurable in-memory Dat-to-HTTP gateway, so you can visit Dat archives from your browser.

If you want a browser that can visit Dat archives, check out Beaker.

Install

To get the dat-gateway command for running your own gateway, use npm:

npm i -g dat-gateway

Usage

You can run dat-gateway to start a gateway server that listens on port 3000. You can also configure it! You can print usage information with dat-gateway -h:

$ dat-gateway -h
dat-gateway

Options:
  --version     Show version number                                    [boolean]
  --config      Path to JSON config file
  --port, -p    Port for the gateway to listen on.               [default: 3000]
  --dir, -d     Directory to use as a cache.[string] [default: "~/.dat-gateway"]
  --max, -m     Maximum number of archives to serve at a time.     [default: 20]
  --maxAge, -M  Number of milliseconds before archives are removed from the
                cache.                                         [default: 600000]
  -h, --help    Show help                                              [boolean]

You can visit Dat archives through the gateway using a route like this:

http://localhost:3000/{datKey}/{path...}

For example:

http://localhost:3000/40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9/assets/img/beaker-0.7.gif

The gateway will even resolve URLs using Dat-DNS:

http://localhost:3000/garbados.hashbase.io/icons/favicon.ico

Contributions

All contributions are welcome: bug reports, feature requests, "why doesn't this work" questions, patches for fixes and features, etc. For all of the above, file an issue or submit a pull request.

License

Apache-2.0

dat-gateway's People

Contributors

garbados avatar icarito avatar pfrazee 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.