-
Notifications
You must be signed in to change notification settings - Fork 0
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
support for multiple apps #8
base: master
Are you sure you want to change the base?
Conversation
aaronshaf
commented
Jul 16, 2018
•
edited
Loading
edited
- .dat-pub/{application key}.json
- rename endpoint -> /applications/{dat-key}/archives
- resolve dat urls
applications.js
Outdated
}) | ||
|
||
// if I load prematurely, it doesn't work | ||
sleep(3000).then(loadAllArchives) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be an await
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, dat location can be immediately returned, even before the hub begins to successfully host it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Cool, that makes sense.
utils.js
Outdated
file = await userArchive.readFile(proofLocation) | ||
} catch (err) { | ||
throw new Error( | ||
`Proof file missing: /.well-known/dat-pubs/${applicationPub.url.slice( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should replace this with Proof file missing: ${proofLocation}
to make it easier to change the location in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Worth another look |
Looks like I should use Nevermind. I'll do that in a future version. |
const { join, basename } = require('path') | ||
const mkdirp = require('mkdirp') | ||
|
||
const APPLICATIONS_DIR = join(__dirname, 'applications') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be configurable by the user.