added promises to claim retrieval and sockets to claim publishing #17

Merged
bones7242 merged 9 commits from master into master 2017-06-01 06:16:13 +02:00
2 changed files with 3 additions and 5 deletions
Showing only changes of commit a181a1e9f1 - Show all commits

View file

@ -12,7 +12,7 @@
<h3>Examples:</h3> <h3>Examples:</h3>
<ul> <ul>
<li><a href="/coconuts">spee.ch/coconuts</a></li> <li><a href="/coconuts">spee.ch/coconuts</a></li>
<li><a href="/sunflower">spee.ch/sunflower</a></li> <li><a href="/wood">spee.ch/wood</a></li>
<li><a href="/doitlive">spee.ch/doitlive</a></li> <li><a href="/doitlive">spee.ch/doitlive</a></li>
<li><a href="/doitlive/all">spee.ch/doitlive/all</a></li> <li><a href="/doitlive/all">spee.ch/doitlive/all</a></li>
<li><a href="/doitlive/ca3023187e901df9e9aabd95d6ae09b6cc69b3f0">spee.ch/doitlive/ca3023187e901df9e9aabd95d6ae09b6cc69b3f0</a></li> <li><a href="/doitlive/ca3023187e901df9e9aabd95d6ae09b6cc69b3f0">spee.ch/doitlive/ca3023187e901df9e9aabd95d6ae09b6cc69b3f0</a></li>

View file

@ -55,7 +55,7 @@ module.exports = function(app){
console.log("/name/claim_id/ promise error:", error) console.log("/name/claim_id/ promise error:", error)
// handle the error // handle the error
if (error === "Invalid URI") { if (error === "Invalid URI") {
res.status(400).sendFile(path.join(__dirname, '../public', 'invalidURI.html')); res.status(400).sendFile(path.join(__dirname, '../public', 'invalidUri.html'));
return; return;
} else { } else {
res.status(400).send(error); res.status(400).send(error);
@ -83,10 +83,8 @@ module.exports = function(app){
if ((error === "NO_CLAIMS") || (error === "NO_FREE_PUBLIC_CLAIMS")){ if ((error === "NO_CLAIMS") || (error === "NO_FREE_PUBLIC_CLAIMS")){
res.status(307).sendFile(path.join(__dirname, '../public', 'noClaims.html')); res.status(307).sendFile(path.join(__dirname, '../public', 'noClaims.html'));
return; return;
} else {
res.status(400).send(error);
return;
}; };
res.status(400).send(error);
}); });
}); });