Skip to content

Commit

Permalink
[update] add "user-agent" field in package.json
Browse files Browse the repository at this point in the history
- HTTP API of jsipfs requires some `User-Agent` request header field to access
  - see: ipfs/js-ipfs#3277
  • Loading branch information
bellbind committed Sep 11, 2020
1 parent ab4719e commit befc683
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 15 deletions.
3 changes: 2 additions & 1 deletion nodejs/server.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const {WSRouter} = require("./ws-router.cjs");

const createServer = () => {
const httpServer = http.createServer((req, res) => {
console.log(req.url); // console out may require some options
//console.log(req.url); // console out may require some options
//console.log(JSON.stringify(req.headers));
res.writeHead(200, {"content-type": "text/html;charset=utf-8"});
res.end("<html><head></head><body>Hello node</body></html>");
});
Expand Down
64 changes: 51 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "stellar-runtime",
"main": "boot.html",
"dependencies": {
"nw": "0.48.1-sdk",
"ipfs": "*",
"ipfs-http-client": "*",
"nw": "0.48.1-sdk",
"websocket": "*"
},
"user-agent": "NW.js",
"chromium-args": "--javascript-harmony --enable-experimental-web-platform-features --enable-logging=stderr",
"scripts": {
"start": "nw"
Expand Down

0 comments on commit befc683

Please sign in to comment.