This criteria serves as the badge criteria for all design patterns.
Use Ubuntu 18 only. No mint!
After starting a clean instance, proceed with the following commands:
Install Gitlab-Runner:
sudo apt-get update
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
The "Identity Provider" (IDP) can be anything that produces a properly signed JWT. The only requirement is that the IDP use the same secret key for signing since the broker will verify the JWT before passing on requests.
For now, we will use Auth0 as our IDP since it is easy to get moving. However, any other IDP will do. For example, if we need to work with Microsoft systems, a simple adapter could be built to convert whatever horrible XML mess they send us into a nice clean JWT.
When connecting to the broker, you must include use "JWT" as the username and the actual signed JWT string as the password.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mosca server is up and running | |
{"pid":6798,"hostname":"byron-virtual-machine","name":"mosca","level":30,"time":1526558598890,"msg":"authentication denied","client":"mqttjs_5679f3cb","v":1} | |
{"pid":6798,"hostname":"byron-virtual-machine","name":"mosca","level":30,"time":1526558598893,"msg":"authentication denied","client":"mqttjs_11a65328","v":1} | |
events.js:167 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: Connection refused: Not authorized | |
at MqttClient._handleConnack (/home/byron/node-typescript-boilerplate/node_modules/mqtt/lib/client.js:893:15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byron@mint-dev-2 ~/Projects/cafe-frontend $ sudo npm i -g [email protected] --unsafe-perm | |
/usr/bin/ocamlmerlin -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin | |
/usr/bin/ocamlmerlin-reason -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin-reason | |
/usr/bin/rtop -> /usr/lib/node_modules/reason-cli/.bin/rtop | |
/usr/bin/utop -> /usr/lib/node_modules/reason-cli/.bin/utop | |
/usr/bin/refmttype -> /usr/lib/node_modules/reason-cli/.bin/refmttype | |
/usr/bin/reopt -> /usr/lib/node_modules/reason-cli/.bin/reopt | |
/usr/bin/rebuild -> /usr/lib/node_modules/reason-cli/.bin/rebuild | |
/usr/bin/reactjs_jsx_ppx_v2 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v2 | |
/usr/bin/reactjs_jsx_ppx_v3 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byron@ubuntu:~$ sudo npm i -g [email protected] | |
/usr/bin/ocamlmerlin -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin | |
/usr/bin/ocamlmerlin-reason -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin-reason | |
/usr/bin/rtop -> /usr/lib/node_modules/reason-cli/.bin/rtop | |
/usr/bin/utop -> /usr/lib/node_modules/reason-cli/.bin/utop | |
/usr/bin/refmt -> /usr/lib/node_modules/reason-cli/.bin/refmt | |
/usr/bin/refmttype -> /usr/lib/node_modules/reason-cli/.bin/refmttype | |
/usr/bin/reopt -> /usr/lib/node_modules/reason-cli/.bin/reopt | |
/usr/bin/reactjs_jsx_ppx_v2 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v2 | |
/usr/bin/reactjs_jsx_ppx_v3 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require("request-promise"); | |
const base = "https://breezy.hr/public/api/v2"; | |
let token = false; | |
const breezy = { | |
login: async function(email, password) { | |
const opts = { | |
method: "POST", | |
uri: `${base}/signin`, | |
body: { email, password }, | |
json: true |
- Wallaby.js working for all popular editors
- Live debug set up in all popular editors (those that can debug, that is)
- Works in Windows, OSX and Linux.
- Frontend is architected to be a large application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(0); | |
console.log(1); | |
console.log(2); | |
console.log(3); | |
console.log(4); | |
console.log(5); | |
console.log(6); | |
console.log(7); | |
console.log(8); | |
console.log(9); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public updateTask(request: Hapi.Request, reply: Hapi.IReply) { | |
let userId = request.auth.credentials.id; | |
let id = request.params["id"]; | |
let task: ITask = request.payload; | |
//the database needs to be wrapped in a Reader here. | |
this.database.taskModel.findByIdAndUpdate({ _id: id, userId: userId }, { $set: task }, { new: true }) | |
.then((updatedTask: ITask) => { | |
//this if needs to be replaced by a monad here. | |
if (updatedTask) { |