Commit 470ad380 authored by wim-vantomme's avatar wim-vantomme
Browse files

Added /listmessages route to mock server 2

parent 476f734c
......@@ -112,3 +112,4 @@ lib/
data/
public/js/script.js
server/files
server2/files
......@@ -19,7 +19,9 @@ Getting up and running is as easy as 1, 2, 3.
cd path/to/spike/Private-messages; npm install
```
3. Start your app
3. Run gulp js:bundle to bundle client javascript files.
4. Start your app
```
npm start
......
......@@ -1700,7 +1700,7 @@ sendForm.addEventListener('submit', (e) => {
message: encryptedMessage
}
axios.post('http://localhost:8181/send', data)
axios.post('http://localhost:8181/send', data, {headers: {'Content-Type': 'application/json'}})
})
}).catch((err) => {
console.log(err)
......
{"salt":"0624d8cb0b653da6094e65cc3020517e","privateKey":"-----BEGIN ENCRYPTED PRIVATE KEY-----\r\nMIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQQ3wkNZgyS1F+R6vYn\r\nA4xhrgIC+gAwDAYIKoZIhvcNAgsFADAdBglghkgBZQMEASoEECPLmRI75C46MLbE\r\nuxMq/T4EggTQUa7soMjCEGhxlw8L4ny1ND6+C58C7JxstzOPC15fBW5QNghRCx36\r\nZodf9ByzXGBkbU9uVtoiCB7LlCZ9geZU80FYrdZ2pMozglmkrJ+pzO5ysXZIV+uv\r\nHNWFsksY6JxVvzo/YMsKtsmIp/GtpANPrz4uW7D1dRoTZpB5t2PA6t/9z4UnDmo1\r\nFMJppsECdNFY6H1gIWrWhISCSU28DbII9zwtUtu0XitFE+Z6N10fdfLsb7fn65vc\r\nHEXCi7Bz3Ad5iHTL1FaJJXSYYKF/x96vGdW/qcmCewWUnG8ObD6TCJ1rc4c1o0Hz\r\nHg5Ex5+rCN1G7JtbWT4ZjbeNmjBQXXw77kZi0+9h0ncYTbBPeMIrgkd8+JBA41ck\r\nnqFidpPVKZurEAc+80x3uqRXXp6h1Bli8tOwNp6UguIqTUxVkj5elwJG72lV6xpu\r\nkNyCc6aga235kF5GbXoXdjq50Yb8krcx4OR37iTscCFYbfw5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0aZhmw3qqtXKc=\r\n-----END ENCRYPTED PRIVATE KEY-----"}
\ No newline at end of file
{"publicKey":"-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiaGLxrmtcwNkCgtnkGyS\r\n0Ph9HCGbFEQpX7AC7mzdpGV49acSjjfgIetUxiUH4le3vLLsxyYHIp7m09otBbuJ\r\nwQ2gbQX17poJ6bQsOf9LSpIkgt/SfVHhjcyZZIXf4B3YnahcH1kH0B901uG0hzzq\r\nvltZFeJRrufQdIfVnZAC57KkGPjBXBHjhnLeKBdMfm8fCA5BWkFomxQMP3qXXQ7W\r\nkeHRWuh++RExhL9XwMJCWR7cf25ZX+eNEcubaPJefml3+MdwVn7lzT0/j6F5xi+x\r\nUxSkAMI/H+XvmEy+ipOl8jp1VxTqxBJC/ZPAQcfw0bEVay/wVd2LKsqr5sFXx94A\r\n/wIDAQAB\r\n-----END PUBLIC KEY-----"}
\ No newline at end of file
{"publicKey":"-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmbfgcFjV3m2lfw3hjO84\r\n4o5J2OXBDkUazOtYd2vLDYd9omZ75ln6xt4q6j2TLwYUoAFCpdJVwQ/GOUWLL7rS\r\nCvJq8iCOFa4ymmH1YnsyrN4cb1eLQkga6o2GP+JgYLVTXGvQC39LoYLNNJWpP81J\r\n3ftqI0gnEkLvYCUM9yVCwzzpTBX+arq4qLCKsibtM+B9f6i6oHMa+sPbQWwFrpaI\r\nt29H4u++5YHJpDAK5DO4EzDOUAUFVFD31/A9lz/EcLzXe0FFboGVIFRjrvEcG2J5\r\nGT7I6ARjdjBFTBjz5p3xuWIUhx0N/y7d58Ud5BAOzT3S/lXP9K30xN0eWebbXeSs\r\n9wIDAQAB\r\n-----END PUBLIC KEY-----"}
\ No newline at end of file
ucfUm1FZenEX/tcoaM05HJXdYafbBFoIjSsikfqtp8Rrgg==
\ No newline at end of file
FcO64oEu4fiMNcdFuMzMEnqxCVQs7TwCSC2X+0yqKFxOdGDWXFIz
\ No newline at end of file
dcMS0MRQLStSNjER+y2CrRMNhI4Jrx8VxjEj9upty12Hb9B887A0wtNduYRZDLcY1YTRpK/RF+tr5b7kry5PNGwrnCpa7b80hxDEzBb9NGT4bQonhEoduS07Sv7P6v/GvfLYCbGLfzXROJn03h1wK9IVWEwhEoitGa1QPBb8PDyJ+3uiNcW4iUMla54+Yz9YC/SGPzJy5TqAG3r6m71DPMAO8zL9h3L43Tni44ZPAblfCgqMb1z/1mb0eYU6H8gU+evyYkHFiUrwz0CSLMOBsDdcM4EV2j4nuFmKnEakBmToqqWRpx5UIdi/7TJSXsA4sFcJQYD1ODhomjLtR1uNEw==
\ No newline at end of file
KSHjX/LchLivcyevZbACNUrrnieme/p9SYmSIzrnenFn5JxdC20G7O92CjKZEPTfVp/xm6jO8cCzJPfHFcGdvB/GnOx75Vh3hdV74SCj1ZwtTYq1K9zBbLpNE/tqtowM3uxk/F76Bep89NHbOS5Ss9vrZD51/9ejZE1bgzM/QV4FWVKwPYagrXQjWrf2h3hhYWXt6eU386mVsfd5ItgSpkJbwM6TigzLxH4OUX/cqYoOi/VpUl1jrk1Iabc6J+1IaKub0Tcqc7J5rbP/6Kn9eSO4PmXt05T+9rcjItcNhpFMKjccZVVsW2E3/s3EZ2/FND+YIChX5WFzUw6z3M+BSQ==
\ No newline at end of file
{"salt":"0624d8cb0b653da6094e65cc3020517e","privateKey":"-----BEGIN ENCRYPTED PRIVATE KEY-----\r\nMIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQQVdzHbjAJ+ngZI8wN\r\nn5IJcAIC+gAwDAYIKoZIhvcNAgsFADAdBglghkgBZQMEASoEEDx8NfzwPvE5uDUz\r\nkRZiea4EggTQ5S5PvTdM4+J6BzXmxW/l7V1lYRf1Eyts8TP2Vc6crrKPJw1Adwhp\r\nr8mfS8k0yDR5DzomSAbB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RhidMc8h3lrPvy96nWpAC7H5kzSQTNEbE1KtL0EERQpMungIJBHvPs5Ej\r\nX+8B/R47Ax1h89XYMHazhnAsfHJJOnO0GjuaDIcy7OkfQ3HvAjLu2/bh4HH5VgPm\r\nVc/juoQi2TUDlxaGw4oR3oWPPMX94x9r5I5ciEk/vPoBAmb9zVitd47/vPrBugVp\r\n/vUaHKfQI22DdIF+r1GcD19Sfn2Fom5AedGsXiLppCcnUdS4YE5wVCwPT/A7cTxF\r\nHv6VewwhsxlUK7KD8hIC8xqg30+X1CGx2/8HjyJw2OiRXhDvpuOG9XsE3JAXD+PG\r\n2PAvbzs6xZK2oLMq7SxdO2LbsZBBaKKjgZkgTSE6uIBadQE8NDxpP21t8y+tEWZY\r\n7MQsYxytkQOWV5MC3E5kWiKN4s1ATgdBcYK4j7YP2eQawsJht2QVvB0=\r\n-----END ENCRYPTED PRIVATE KEY-----"}
\ No newline at end of file
{"publicKey":"-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqr7suxdnXQOGVU+lB6mI\r\nXrGUFuYgkGovB51M/jLcM4w182ErnOEN1d9Bp/BssNRNWDLovwSDdIv6cyPGurFK\r\n87z11TLGKORdBhu54aGVFh55ljNDd1iUx1lm9JAzpJfVkanL7xFl1wGtIAYjIlyw\r\n27pPjoGNRuJEU/TJP1f9/e5TfqxKFBt21yemg4Yp3Hsfz0KHZ7JtUcD6VnYg+ZE7\r\nnoSaGaR2R8v/mCHolO2O/cnjR0/VQiUhN0gFFkjThXWud6Kx7gIVRUseChbc8doL\r\nupSHyOgbda3dqhhG2cePDo/uDXhDrnji1kua64kTiP3BaWF59e3TR0JirzddXpVE\r\ndQIDAQAB\r\n-----END PUBLIC KEY-----"}
\ No newline at end of file
{"publicKey":"-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1urQrcK0qFW6vQessNmD\r\nzwFH2l8mUaHbmNWkKx8PohSTFwqfSYyogmRXcfxzxMzN4hr8GH/u/AUik5KjdGg7\r\nDB5xC/yChXta5KItGeIF6o7fe1im8AbkHY/i9EGrxcw6l8954dm2rZTq/U0te5+9\r\npSR9su9ZQpRmdmx7/1r0Hpc/358V5Wl/fki2AJ6mVXgeHMoCPPZHTs5envDbOYXY\r\nVdhwX+G5m2/vG4pwpMdYHv8Xja2tbngBrkyn6DoPvHSRgARosXZlJGXKMviJO6h1\r\nHOHenGwOOTx2n4I0Y+7AFIVoeWOrJwNg/p6Sij7K4N0ZPIpQcBeyAQ2lSLstJJFb\r\nKQIDAQAB\r\n-----END PUBLIC KEY-----"}
\ No newline at end of file
......@@ -153,4 +153,20 @@ app.post('/send', (req, res) => {
})
})
app.get('/listmessages', (req, res) => {
const readMessage = fileUtils.readFile('./server2/files/message.json')
const readKey = fileUtils.readFile('./server2/files/sessionkey.json')
Promise.all([readMessage, readKey]).then((values) => {
const data = {
sessionKey: values[1],
message: values[0]
}
res.status(200).send(data)
}).catch((err) => {
console.log(err)
res.status(500).send('Ooops, something went wrong')
})
})
app.listen(8181)
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