Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@fabric/http — Edge Nodes #51

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
58bc80c
Upgrade puppeteer
martindale Jan 1, 2024
da1d518
Update package-lock.json
martindale Jan 2, 2024
cae5dc3
Update install report
martindale Jan 2, 2024
8ba17de
Add deep fetch to Remote API
martindale Jan 2, 2024
6ecc6d3
Switch to await for all responses
martindale Jan 3, 2024
421768b
Return error on all unhandled status codes (Remote)
martindale Jan 4, 2024
364425b
Remove GraphQL components
martindale Jan 11, 2024
fb57aec
Further disable GraphQL
martindale Jan 11, 2024
f733bd3
Update package-lock.json
martindale Jan 20, 2024
54f2e3e
Update install report
martindale Jan 25, 2024
30b4092
Update Fabric ZMQ dependency
martindale Jan 28, 2024
f7082e8
Update to latest Fabric
martindale Feb 8, 2024
338b125
Update to latest Fabric
martindale Feb 8, 2024
a580eb5
Update to latest @fabric/core
martindale Feb 20, 2024
9b76a98
Import latest changes
martindale Feb 20, 2024
086b9dc
Install latest packages
martindale Feb 26, 2024
e5e20f3
Update package-lock.json
martindale Feb 27, 2024
f07b454
Reduce warnings to verbosity > 2
martindale Mar 4, 2024
dc9a505
Wrap old handler in try/catch
martindale Mar 14, 2024
48b15e0
Update install report, package-lock.json
martindale May 15, 2024
68b41d4
Update package-lock.json, install report
martindale Jun 5, 2024
90c2d19
Update dependencies, inherit various fixes
martindale Jun 26, 2024
ac8503e
Update package-lock.json, install report
martindale Jul 11, 2024
5b9347f
Update install report from latest Fabric
martindale Sep 24, 2024
cb726e8
Update dependencies, install report
martindale Oct 21, 2024
c0db175
Use latest Fabric, include security fixes
martindale Oct 28, 2024
5d0c591
Add _addAllRoutes to Server
martindale Oct 29, 2024
7c1bf81
Correct route implementation
martindale Oct 29, 2024
77e7b2f
Further fixes to routing
martindale Oct 29, 2024
60b64ff
Import latest Fabric, update install reports
martindale Nov 3, 2024
90be662
Import Fabric changes, update package-lock.json
martindale Nov 3, 2024
6fffe13
Update Fabric Core, package-lock.json, install report
martindale Nov 5, 2024
0075eaa
Add system dependencies for Ubuntu and macOS in GitHub Actions
sweep-ai[bot] Nov 6, 2024
ab5f618
Update README, remove canvas
martindale Nov 27, 2024
356fcf8
Merge branch 'feature/v0.1.0-RC1' of github.com:FabricLabs/fabric-htt…
martindale Nov 27, 2024
b004541
Use latest Fabric, addresss a number of vulnerabilities
martindale Dec 3, 2024
0bc9c46
Notify migration to Node 18.19.1
martindale Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,33 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@v3

- name: Install system dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

- name: Install system dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install pkg-config cairo pango libpng jpeg giflib librsvg

- name: Install Node.js on ${{ matrix.os }}
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci
env:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:/opt/homebrew/lib/pkgconfig

- name: Generate coverage report
run: npm run report:coverage

- name: Send coverage report
uses: codecov/codecov-action@v3.1.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.19.0
v18.19.1
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
dist: focal
language: node_js
node_js:
- 16.17.1
- 18.19.1
before_install:
- sudo apt-get update
- sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- npm install -g codecov
after_success:
- npm run report:coverage
Expand Down
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,44 @@
[![Community](https://img.shields.io/matrix/hub:fabric.pub.svg?style=flat-square)](https://chat.fabric.pub)

Robust library for implementing Fabric-enabled Web Applications.
## TODO
- [ ] Replace `Fabric-enabled` with `Bitcoin-enabled`

## What is Fabric?
[Fabric][fabric] is an attempt at replicating the World Wide Web ("the WWW") as a peer-to-peer network, using payment relationships to exchange documents and scale the network. `@fabric/http` provides a framework for hosting Fabric-enabled applications over HTTP, allowing them to be used as "edge servers" for legacy web users.

## Quick Start
Building applications with `@fabric/http` is easy.

```
mkdir myapp && cd myapp
npm init
npm i --save @fabric/http
```sh
mkdir some-project && cd some-project
npm init # Initialize the project
npm i --save @fabric/http # Install the @fabric/http dependency
```

Create an application by creating a new file (here we've used `scripts/app.js`), containing the following:
### `scripts/app.js`:
Create an application by creating a new file (here we've used `scripts/node.js`), containing the following:
### `scripts/node.js`:
```js
'use strict';

// Dependencies
const SPA = require('@fabric/http/types/spa');

// Main Process
async function main () {
const spa = new SPA({
name: 'Example App',
synopsis: 'Simple demonstration of a single-page app.',
name: 'Example Application',
synopsis: 'Simple demonstration of a single-page application.',
resources: {
'Todo': {
description: 'A to-do list item.'
}
}
});

// Start the Process
await spa.start();

// Return reference
return { id: spa.id };
}

main().catch((exception) => {
Expand All @@ -45,10 +52,7 @@ main().catch((exception) => {
});
```

Run `node scripts/app.js` to start the app, or `webpack scripts/app.js -o assets/app.min.js` to
Run `node scripts/node.js` to start the app, or `webpack scripts/app.js -o assets/app.min.js` to
build a browser version.

### Advanced: `@maki/roller`

## Maki, making beautiful apps a breeze
Try `maki roll examples` in this repo for a mind-blowing experience.
[fabric]: https://fabric.pub
2 changes: 1 addition & 1 deletion middlewares/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function FabricAuthenticationMiddleware (request, response, nex

}
} else {
this.emit('debug', `[WARNING] No "${HTTP_IDENTITY_HEADER_NAME}" header. Consider rejecting here.`);
if (this.settings.verbosity > 2) this.emit('warning', `[WARNING] No "${HTTP_IDENTITY_HEADER_NAME}" header. Consider rejecting here.`);
}

return next();
Expand Down
Loading
Loading