Skip to content

Commit

Permalink
Fix antimatter_wiki host/domain param
Browse files Browse the repository at this point in the history
  • Loading branch information
toomim committed Apr 4, 2024
1 parent 368917d commit 5e3f384
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions antimatter_wiki/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Example app

var port = 60509,
host = 'localhost'
domain = 'localhost:60509'

process.on('uncaughtException', console.log)
process.on('unhandledRejection', console.log)

require('@braidjs/antimatter_wiki').serve({port, host})
require('@braidjs/antimatter_wiki').serve({port, domain})
2 changes: 1 addition & 1 deletion antimatter_wiki/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@braidjs/antimatter_wiki",
"version": "0.0.2",
"version": "0.1.0",
"description": "collaborative wiki using antimatter sync algorithm",
"main": "server.js",
"author": "Braid Working Group",
Expand Down
4 changes: 2 additions & 2 deletions antimatter_wiki/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var default_fissure_lifetime = 1000 * 60 * 60 * 24 * 14 // 14 days
var fs = require('fs')
var fs_p = require('fs/promises')

function serve({port, host, fissure_lifetime = default_fissure_lifetime}) {
function serve({port, domain, fissure_lifetime = default_fissure_lifetime}) {
console.log('v28')

let {antimatter} = require('@braidjs/antimatter')
Expand Down Expand Up @@ -101,7 +101,7 @@ function serve({port, host, fissure_lifetime = default_fissure_lifetime}) {
function respond_with_client (req, res) {
var client_html = fs.readFileSync('node_modules/@braidjs/antimatter_wiki/client.html')
client_html = '' + client_html
client_html = client_html.replace(/__WIKI_HOST__/, `ws://${host}:${port}`)
client_html = client_html.replace(/__WIKI_HOST__/, `ws://${domain}`)
var etag = require('crypto').createHash('md5').update(client_html).digest('hex')
if (req.headers['if-none-match'] === etag) {
res.writeHead(304)
Expand Down

0 comments on commit 5e3f384

Please sign in to comment.