You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Setting up your environment is done in three easy steps:
17
17
18
18
#### Hooking things up with docker-compose
19
19
20
-
Alter the `docker-compose.yml` file so it contains all microservices you need. The example content should be clear, but you can find more information in the [Docker Compose documentation](https://docs.docker.com/compose/). Don't remove the `identifier` and `db` container, they are respectively the entry-point and the database of your application. Don't forget to link the necessary microservices to the dispatcher and the database to the microservices.
20
+
Alter the `docker-compose.yml` file so it contains all microservices you need. The example content should be clear, but you can find more information in the [Docker Compose documentation](https://docs.docker.com/compose/). Don't remove the `identifier` and `database` container, they are respectively the entry-point and the database of your application. Don't forget to link the necessary microservices to the dispatcher and the database to the microservices.
Web applications oftentimes require a user to be authenticated to access (part of) their application. For example a webshop may require a user to be logged in before placing an order. In a previous blog post we already explained [the semantic model to represent logged in users](https://mu.semte.ch/2017/08/24/representing-logged-in-users/). In this post we will show how to enable authentication in your app. We assume you already have a [mu-project](https://github.com/mu-semtech/mu-project) running.
390
+
Web applications oftentimes require a user to be authenticated to access (part of) their application. For example a webshop may require a user to be logged in before placing an order. In a previous blog post we already explained [the semantic model to represent logged in users](https://mu.semte.ch/2017/08/24/representing-logged-in-users/). In this post we will show how to enable authentication in your app. We assume you already have a [mu-project](https://github.com/mu-semtech/mu-project) running, with an ember front-end project.
391
391
392
392
Adding authentication to your application consists of two tasks:
393
393
@@ -555,7 +555,7 @@ And that's it! Now you know how your mu-project can be easily augmented with aut
555
555
556
556
557
557
### Building a mail handling service
558
-
My goal for this short coding session is to have a mail handling service that will allow me to list and maninpulate mails through a JSON:API REST back-end. And have that service pick up when I write a mail to the database and send it automatically. You can see the result of this project at https://github.com/langens-jonathan/ReactiveMailServiceExample.
558
+
My goal for this short coding session is to have a mail handling service that will allow me to list and manipulate mails through a JSON:API REST back-end. And have that service pick up when I write a mail to the database and send it automatically. You can see the result of this project at https://github.com/langens-jonathan/ReactiveMailServiceExample.
559
559
560
560
#### Gain a head-start with mu-project
561
561
For this project I started with cloning the mu-project repository:
@@ -610,7 +610,8 @@ A GET call to http://localhost/mails produces:
610
610
"data": [],
611
611
"links": {
612
612
"last": "/mails/",
613
-
"first": "/mails/"
613
+
"first": "/mails/",
614
+
"self": "mails"
614
615
}
615
616
}
616
617
```
@@ -680,7 +681,7 @@ Before we can start writing our reactive mail managing micro-service, we will ne
680
681
delta:
681
682
image: semtech/mu-delta-service:beta-0.7
682
683
links:
683
-
- db:db
684
+
- database:database
684
685
volumes:
685
686
- ./config/delta-service:/config
686
687
environment:
@@ -691,7 +692,7 @@ delta:
691
692
This will add the monitoring service to our installation. The last thing to do for now is to change the link on the `resource` microservice by replacing
692
693
```yaml
693
694
links:
694
-
- db:database
695
+
- database:database
695
696
```
696
697
with
697
698
```yaml
@@ -703,8 +704,8 @@ The final steps are to create the configuration and subscribers files. Create a
703
704
704
705
```conf
705
706
# made by Langens Jonathan
706
-
queryURL=http://db:8890/sparql
707
-
updateURL=http://db:8890/sparql
707
+
queryURL=http://database:8890/sparql
708
+
updateURL=http://database:8890/sparql
708
709
sendUpdateInBody=true
709
710
calculateEffectives=true
710
711
```
@@ -849,7 +850,7 @@ There are 2 types of delta reports, you have potential inserts and effective ins
849
850
```
850
851
*You can view the full version [here](https://gist.githubusercontent.com/langens-jonathan/cd5db8e9f68861662d888dad77f93662/raw/84adc69f9fd3143f45c05c0a5cefdf1ca9b95b55/gistfile1.txt).*
851
852
852
-
A report states the query that was send, an array of inserted objects and an array of deleted objects: Inserted or deleted objects represent a single triple with s, p and o being subject, predicate and object.
853
+
A report states the query that was sent, an array of inserted objects and an array of deleted objects: Inserted or deleted objects represent a single triple with s, p and o being subject, predicate and object.
853
854
854
855
#### Expanding our mail handling microservice
855
856
We need to notify the delta service of the existence of our mail handling service. We do this using the `subscribers.json` file that was created before. Change it so it looks like:
@@ -870,7 +871,7 @@ In the `docker-compose.yml` file we need to alter the delta-service definition t
870
871
delta:
871
872
image: semtech/mu-delta-service:beta-0.8
872
873
links:
873
-
- db:db
874
+
- database:database
874
875
- mailservice:mailservice
875
876
volumes:
876
877
- ./config/delta-service:/config
@@ -898,7 +899,7 @@ Then we define a new method that will:
898
899
- Load the delta report into a variable
899
900
- Define some variables.
900
901
901
-
Lastly we define an array that will hold the URI’s of all emails that need to be send.
902
+
Lastly we define an array that will hold the URI’s of all emails that need to be sent.
902
903
903
904
904
905
```python
@@ -912,7 +913,7 @@ def processDelta():
912
913
# continued later...
913
914
```
914
915
915
-
We will loop over all inserted triples to check for mails that are ready to be send:
916
+
We will loop over all inserted triples to check for mails that are ready to be sent:
916
917
```python
917
918
# mail-service/web.py
918
919
def processDelta():
@@ -1176,7 +1177,7 @@ Add this snippet to your docker-compose.yml:
0 commit comments