Mise à jour de GitLab prévue ce samedi 23 octobre 2021 à partir de 9h00 CET

Commit 89fda30d authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Reorganisation of the source code

parent aa1acfac
......@@ -30,13 +30,13 @@ module.exports.lookup = function (req, res) {
count = 1;
armor = foundKeys[0].raw;
}
res.render('../views/pks/lookup_get.ejs', {"armor": armor, "search": pattern, "nbKeys": foundKeys.length}, function (err, text) {
res.render('../app/views/pks/lookup_get.ejs', {"armor": armor, "search": pattern, "nbKeys": foundKeys.length}, function (err, text) {
res.writeHead(200, {"Content-type": "text/html"});
res.end(text);
});
break;
case 'index':
res.render('../views/pks/lookup.ejs', {"pubKeys": foundKeys}, function (err, text) {
res.render('../app/views/pks/lookup.ejs', {"pubKeys": foundKeys}, function (err, text) {
res.writeHead(200, {"Content-type": "text/plain"});
res.end(text);
});
......@@ -162,7 +162,7 @@ module.exports.add = function (req, res) {
}, function (err) {
// Creates/updates done.
if(!err){
res.render('../views/pks/added.ejs', {"pubKeys": pubKeys}, function (err, text) {
res.render('../app/views/pks/added.ejs', {"pubKeys": pubKeys}, function (err, text) {
res.writeHead(200, {"Content-type": "text/plain"});
res.end(text);
});
......
......@@ -3,12 +3,12 @@ _ = require('underscore');
module.exports.pks = {
add: function (req, res) {
res.render('../views/pks/add.ejs');
res.render('../app/views/pks/add.ejs');
}
};
module.exports.amendments = {
submit: function (req, res) {
res.render('../app/views/addAmend.ejs');
res.render('../app/views/amendments/addAmend.ejs');
}
};
\ No newline at end of file
var express = require('express');
var fs = require('fs');
var async = require('async');
var config = require('../config');
var config = require('../../config/config');
var path = require('path');
var mongoose = require('mongoose');
var _ = require('underscore');
......@@ -10,7 +10,7 @@ var configurer = require('../lib/configurer');
module.exports.database = {
init: function () {
var models_path = __dirname + '/../app/models';
var models_path = __dirname + '/../models';
fs.readdirSync(models_path).forEach(function (file) {
if (~file.indexOf('.js')) require(models_path + '/' + file);
});
......@@ -34,9 +34,9 @@ module.exports.express = {
res.end();
}
var amend = require('./amendments');
var pks = require('./pks');
var web = require('./web');
var amend = require('../controllers/amendments');
var pks = require('../controllers/pks');
var web = require('../controllers/web');
app.get( '/pks/lookup', pks.lookup);
app.post( '/pks/add', pks.add);
......
var jpgp = require('../../lib/jpgp');
var jpgp = require('../lib/jpgp');
var mongoose = require('mongoose');
var async = require('async');
var _ = require('underscore');
......@@ -56,6 +56,10 @@ function multipleLinesExtraction(am, wholeAmend, cap, done) {
AmendmentSchema.methods = {
parse: function(rawAmend, callback) {
if(!rawAmend){
callback("No amendment given");
return;
}
var obj = this;
var captures = [
{prop: "version", regexp: /Version: (.*)/},
......
var jpgp = require('../../lib/jpgp');
var jpgp = require('../lib/jpgp');
var mongoose = require('mongoose');
var async = require('async');
var _ = require('underscore');
......
#!/usr/bin/env node
var config = require('../config'),
http = require('http'),
nodecoin = require('../lib/nodecoin'),
program = require('commander');
var config = require('../config/config');
var nodecoin = require('../lib/nodecoin');
var http = require('http');
var program = require('commander');
function keys (val) {
return val.split(',');
......
......@@ -2,14 +2,14 @@
"name": "nodecoin",
"version": "0.0.4",
"description": "OpenUDC-like implementation using Node.js",
"main": "lib/nodecoin.js",
"main": "bin/nodecoin",
"directories": {
"test": "test"
},
"scripts": {
"preupdate": "sh preupdate/jpgp jpgp-0.0.2-SNAPSHOT.jar",
"preinstall": "sh preinstall/jpgp jpgp-0.0.2-SNAPSHOT.jar",
"pretest": "sh preinstall/jpgp jpgp-0.0.2-SNAPSHOT.jar",
"preupdate": "sh scripts/preupdate/jpgp jpgp-0.0.2-SNAPSHOT.jar",
"preinstall": "sh scripts/preinstall/jpgp jpgp-0.0.2-SNAPSHOT.jar",
"pretest": "sh scripts/preinstall/jpgp jpgp-0.0.2-SNAPSHOT.jar",
"test": "mocha test/*.js",
"start": "bin/nodecoin"
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment