Giter Site home page Giter Site logo

apm-serve's Introduction

apm-serve

Web 2.0 server for Web 3.0 APM hosted dApps

Goal API

  • dapp.aragonpm.com -> serves content from latest version of dapp.aragonpm.eth in the mainnet
  • dapp.rinkeby.aragonpm.com -> serves content from latest version of dapp.aragonpm.eth in rinkeby (requires setting ENS address)
  • 1.2.3.dapp.aragonpm.com -> serves version 1.2.3 of dapp
  • voting.aragonpm.com/?json=true -> serves json with all versions of voting.aragonpm.eth with smart contract addresses and contentURIs
  • voting.aragonpm.com/?json=true&version=1.2.3 -> serves version information for voting.aragonpm.eth 1.2.3

What about running it on myregistry.eth?

  • Use the docker image to deploy to your hosting service of choice and configure it for your registry

Roadmap

  • v1: HTTP serve contentURI of a given package, for different networks and versions.
  • v2: JSON API
  • v3: DNS gateway like ipfs-gateway, that would allow just running 1 instance of apm-serve and people being able to serve registries or specific content just by configuring DNS.

apm-serve's People

Contributors

2color avatar bpierre avatar dependabot[bot] avatar izqui avatar onbjerg avatar pbostrom avatar sohkai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apm-serve's Issues

Name

By my personal preference order:

  • apm-serve
  • apm-gateway
  • apm-server

Fallback to second last version if latest version is unresolvable

During deployments, mainnet.aragon.org and rinkeby.aragon.org usually come down for a few minutes because apm-serve is trying to get the latest content that the connected IPFS node doesn't know have cached yet.

Ideally we would wait a maximum of 500ms to 1s on resolving the latest version of a package, before falling back to loading the last version.

To avoid having false fallbacks in times of high load, we could cache whether we've been able to serve a version of a package and avoid doing the fallback if so.

Redirect to `/` if a given path doesn't exist

apm-serve currently tries to fetch content provided in a package.

For example, aragon.mainnet.aragonpm.com/manifest.json fetches the deployment manifest.json, but aragon.mainnet.aragonpm.com/organization may be a common typo and should at least redirect to the index.

Given that apm-serve is only serving as a gateway to frontends deployed on aragonPM, redirecting to / (to get the index.html, if one exists) is akin to what would need to happen with SPA-based routers anyway.

Brotli support

Support for Brotli recently landed in Node.js (11.7.0), and should be added to compression soon.

Iโ€™m opening this issue to remember to upgrade compression when the feature gets released, so we can start using it as soon as possible.

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.