All language subtitles for 036-Creating the Data Query Service-git.ir

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In this video we're going to get started working on our query service to remember the goal of this service.

We want to have one service that we can make a request to to get a full listing of all the different

posts and their associated comments.

The one request all the data we need to actually implement this thing we're going to give it to different

root handlers one root Handler's going to receive events from our event bus.

Our query service is going to care about events of type posts created and come and created whenever

it sees these events.

It's going to take the data contained inside the event itself and then assemble it all into some very

easy to access data structure.

The second end point that we're going to implement is going to have a handler for watching a GET request

to slash posts anytime so it makes a GET request to that endpoint.

We're going to send back a full listing all posts and related comments.

So let's get start working on our query service.

Right now again I'm going to open up yet another terminal window here's my new window right here.

I'm going to change back into our route blog directory.

That's where all of our services live right now.

And inside there I'll make a new folder we'll call complete query or then change into that directory.

And I'm going to generate a package dot JS on file using NPM minute dash y after I generate that file.

Well then go ahead and install two dependencies.

All we need for this service is express and course the query service itself is not going to actually

emit any events.

And that's why we are not installing axles.

I know ahead of time that the query service is not going to commit any events but if you were working

on this from scratch and if you were unsure about whether or not this thing was going to be met any

events you would go ahead and install axles until you were sure that OK.

I don't actually need to treatment and events and then you can remove that dependency.

So I'll go ahead and do that installation I'll then go back over to my editor and I should see that

new query directory so let's start to build this Express application out inside of that directory.

I'll make a new file called index dot J.S. and then at the top let's go ahead.

We're going to require an express body parser and that course module as well will get Express will get

body parser

and I'll get yours I'll then create my new express app and I will wire up the body of parser

and I will wire up cause OK so it looks good now we're going to put together our two root handlers remember

the two that we want are for a get to slash post and they post to slash events we'll do app dot get

slash post and then put it in our rec and rez.

And right now I'll just see that empty and then the next one will be app dot post to slash events.

So this is of course the end point that is going to receive events from our event bus then finally at

the very bottom.

Let's go ahead and set up that app.

Listen call it will do an app listen and remember.

At present we are using a couple of different ports.

We've got ports or thousand 1001 and 4000 to I think now just 4000 of 4000 one.

This one will be at 4000 and to open in our callback inside of here we'll do a console log listening

on 4000 to before we start to worry about any implementation here just yet.

Let's make sure we can actually run this project it's going to save this file.

I'll go back over to a package that Jason and we'll set up a startup script that's what we forgot on

dependencies we've got to get Node 1.

We'll go and install that really quickly as well.

Rebecca my terminal will do an MP install node on

and then once that is installed we can update that start script though start with the node man index

that J.S. let's just run this project really quickly to make sure we don't have any typos or anything

like that.

So at my terminal in the window that is running our query service we'll do an NPM start and there we

go listing on 4000 to.

Well now that we've got all this boilerplate put together we can start worrying about the actual implementation

of the post events end point and get post as well.

We'll do a quick break first and then start to worry about those two end points in just a moment.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.