►
From YouTube: React JS Meetup
Description
In this meetup we look at using react on the server, to wrap express and declaratively create an API server.
https://blog.hyper63.com/react-the-great-abstraction/
https://github.com/hyper63/react-server-demo
A
All
right
welcome
everyone
thanks
for
joining
charleston
js.
This
is
the
react.
Js
meetup,
so
we're
doing.
Weekly
meetups
each
week
will
be
kind
of
a
different
theme.
A
One
will
be
node
which
we
had
last
week
and
then
this
week
react
and
then
we'll
do
dino
and
functional
programming
and
then
swelt
and
view
so
each
week
we're
going
to
do
30
minutes
and
have
a
presentation
and
and
possibly
lightning
round,
presentations
too.
A
So
if
you
have
any
questions,
please
don't
hesitate
to
ask
in
the
chat
and
I'll
answer
them
and
then
you
know
just
let
me
get
through
a
little
demo
and
we'll
take
some
questions
so
with
that
started.
A
React
on
the
server
react
is
a
presentation,
library
and
most
of
it
works
with
the
web
or
mobile
or
tvs,
and
just
all
kinds
of
presentation,
layers
and
and
the
abstraction
has
worked
really
well
that
other
folks
have
found
other
ways
to
abstract
react.
A
That's
why
I
kind
of
say
react.
The
planet.
You
can
build
command
line,
applications
with
react.
You
can
put
react
on.
I
think
I've
seen
some
stuff
with
hardware
or
animations
music,
just
about
anything
you
think
can
think
of,
but
just
a
few
weeks
ago
I
found
this
library
react-nil
and
this
library
kind
of
allows
you
to
think
about
react
on
the
server.
A
So
with
that,
that's
what
we're
going
to
do
today,
we're
going
to
see
if
we
can't
get
react
to
work
on
the
server-
and
I
don't
know
I
I
kind
of
call
it
mad
science.
It
might
not
be
mad
science,
but
but
we'll
we'll
see
so
we're
gonna.
Try
to
you
know
kind
of
create,
like
a
express
framework
where
you
can
write,
will
build
on
top
of
express,
but
where
you
can
write
react
to
declare
your
framework.
So
something
like
this:
where
you'll
have
your
render,
and
then
you
define
your
components.
A
A
I've
got
a
little
handler
function
here,
just
a
request
handler
function
that
takes
a
request,
object
and
a
response
object.
You
know
just
like
in
express
and
what
we're
going
to
do
is
just
import
react
just
like
we
would
do
it
on
the
front
end
and
then
we're
going
to
import.
This
render
function
from
this
library
called
react,
dash
mill
and
basically
all
that
library
does
is.
It
goes
into
react
and
it
voids
or
nulls
out
all
of
the
places
where
react
returns
dom.
A
A
A
A
Sorry
about
that
and
we're
gonna
pull
that
from
hyper
hyper.js.
Just
the
file
I
created
and
these
three
components
the
app
component
will
set
up
our
express
server.
The
request
component
will
take
the.
A
Server
app
and
express
you
see
it
represented
like
this,
you
know.
Basically,
it's
going
to
write
out
a
function
like
app,
get
slash
and
then
the
the
handler
right
hello.
So
so
the
request
is
just
gonna
kind
of
write
that
code
out
and
we'll
show
you
how
that
looks
in
a
minute
and
then
the
listen
is
just
going
to
call
like
app.listen
3000..
A
So
that's
our
first
stab
at
this
we'll
run
this.
This
is
running
in
dino,
which
is
kind
of
cool,
but
I
can
just
start
it
up
like
that
and
let's
see,
got
a
bug
on
line
10..
Let's
see,
I
forgot
to
close
my
listen
component.
Okay,
now
we'll
start
that
up
and
hopefully
we'll
be
listening
on
port
3000
in
just
one
second,
the
nice
thing
about
dino.
Is
you
give
it
a
jsx
or
tsx
file
and
it'll
automatically
kind
of
compile
everything
for
you?
You
don't
have
to
set
up
anything
there.
A
We
go
we're
listening
on
port
3000,
so
we're
going
to
just
curl
local
localhost
3000
and
we
get
hello
charleston.js,
pretty
cool.
So
so
we're
writing
react
on
the
server
and
let's
take
a
look
and
see
how
that
actually
works.
A
So
if
you
look
at
this
library
called
opine,
it's
basically
a
clone
of
express
and
dino,
so
everything
works
like
express
and
then
we
have
react
and
what
we're
doing
is
we're
building
components
and
in
their
functional
components.
So
in
the
app
component
we
take
in
props
and
we
just
iterate
through
the
children
and
we
attach
the
app
prop
or
attach
an
app
prop,
which
is
the
express
application.
So
here
would
be
like
start
express
and
we
assign
it
to
app
and
we
just
iterate
through
the
children
and
merge.
A
If
you
will
the
app
property
into
the
child
and
then
return
the
child
and
then
the
second
component
request
gets
app
as
a
property
and
then
the
method
property
is
assigned
to
git.
So
we
could
say:
let's
do
a
post,
let's
do
whatever
a
put,
but
if
we
don't
specify
it
it'll
default
to
a
get,
and
then
we
have
our
path
and
handler
these
two
properties
we
passed
into
our
component
when
we
declared
that
in
react
and
then
like
I
said,
we
just
call
app
the
method
path
and
the
handler.
Now.
A
A
So,
let's
see
if
we
can
take
this
a
little
further
and
actually
write
a
you
know,
react
is
kind
of
famous
for
its
counter
apps.
So,
let's
see
if
we
can
write
a
simple
counter
where,
if
you
do
a
get
to
the
root,
it
will
return
the
count
and
then,
if
you
post
an
ad
path,
it
will
increment
it
and
we'll
just
stick
with
that
for
right
now,
just
to
make
sure
I'm
good
on
time.
A
So
if
we
go
into
mod
jsx
and
we've
got
our
app
and
one
of
the
things
I
wanted
to
do
is
is
just
kind
of
take
this
a
little
bit
further.
We've
got
this
handler
method,
but
what
if
we
just
did
this?
What
if
we
did
request
and
in
request
and
then
inside
there
added
a
child
for
a
component
right?
So
let's
just
call
it
counter
right,
then
that
way
we
we
take.
This
request,
and
then
we
just
add
this
child
counter,
which
is
another
component,
and
then
we
could
have
another
request.
A
And
then
let's
call
counter,
but
let's
give
it
a
property
increment
equals
true
or
something
like
that.
Right.
A
And
then
we'll
end
that
with
a
request:
okay,
okay,
so
we
might
have
to
make
some
changes
on
our
request
component
to
look
at
a
child
and
treat
it
as
a
component.
And
I
I
really
went
ahead
and
already
did
that
here
on
hyper2
and
we
can
look
at
that.
But
now
we're
defining
components,
not
just
handler
functions.
So
we
want
to
create
a
counter
component.
A
Oh
one,
second,
and
let's,
let's
go
really
crazy
and
bring
in
use
state.
Okay,
so
we're
going
to
bring
in
our
hooks
and
in
this
counter
component.
A
I
think
what
we're
going
to
do
is
in
the
props,
there's
going
to
be
a
handler
and
we're
going
to
pass
it
a
function
for
the
hammer
so
there
in
the
props.
There
will
be
a
handler
function
that
hands
this
component
and
then
that's
what
we'll
we'll
call,
but
first
we'll
set
up
use,
state
and
we'll
do
count,
set
count
and
then
that'll
be
use.
A
A
A
A
Host
cool,
we
got
count
so
now.
We've
got
this
post
path,
add
and
we're
going
to
call
the
counter
again,
but
we're
going
to
set
this
prop
ink.
True
so
up
here
on
our
counter,
we're
going
to
say
if
props
dot,
inc.
A
A
B
A
A
A
Maybe
this,
if
statement's
not
right,
maybe
I'm
creating
something
there
but
anyway.
So,
let's,
let's
do
it
this
way,
let
count
and
then
we
have
count
set
and
then
we
call
add
we'll
do
count.
Equals
plus
equals
one
right.
B
A
Okay,
so
hopefully
there
we
go,
it
started
this
post
and
we
got
count
two
which
is
interesting.
A
Let's
do
get
count
two
and
okay,
so
I
know
what's
going
on
the
reason
that
it's
calling,
that
is
because
if
we
look
at
our
render
the
handler,
the
component's
getting
called
twice
right,
request
and
request
is
getting
called
twice.
So
that's
why
count
is
equal
to
two.
So
we
really
need
to
kind
of
put
this
count
inside
our
handler.
A
Function
and
now,
if
we
run
this,
we
should
should
get
things
working.
C
C
A
Sorry
about
the
background
noise:
let's
see
if
this
works.
A
A
Post
okay,
so
it's
not
blowing
up,
but
something's
something's,
not
working
right
with
state,
and
it's
probably
an
error
on
my
side.
But
but
anyway,
hopefully
you
can
kind
of
get
the
idea.
This
is
kind
of
an
interesting
approach
and
just
to
show
you
how
that
kind
of
works.
If
we
look
at
hyper2
js,
basically,
the
request
object
is
mapping
over
the
children,
verifying
if
it's
a
valid
element
and
then
cloning
that
and.
A
So
what
it
should
be
doing
is
taking
that
handler
function
and
passing
that
in
as
a
prop
and
I'm
just
not
seeing
it
oh
here,
it
is
so
when,
when
the
clone
element
happens,
it
merges
and
it
passes
this
handler
and
injects
this
handler
function
that
takes
a
function
and
then
it
calls
the
app
method,
path
and
function.
A
So
anyway,
that
is
my
take
at
trying
to
use
react
to
build
a
server
framework
or
something
don't
know
what
it
is,
but
I
think
there's
a
lot
of
space
to
explore
here,
especially
like
creating
declarative
business
logic
or
working
with
you
know,
kind
of
giving
your
team
a
really
nice
composable
way
to
compose
kind
of
some
business
rules.
So
I
I
think,
there's
some
really
interesting
things
to
explore
here.
So
that's
that's
what
I
wanted
to
show
today,
any
any
other
questions.
A
It's
kind
of
cool,
just
seeing
react,
run
on
the.
A
A
And
I'm
going
to
keep
working
with
this
and
if
I'm
able
to
get
through
some
of
the
use,
state
or
use
effect,
stuff
I'll
I'll,
definitely
share
with
the
group.
A
All
right
with
that,
any
any
shout
outs
or
does
anyone
else
have
anything
they
would
like
to
share.
B
Yeah,
actually,
this
seems
like
the
place
to
do
it.
Hi
I'm
robert
articulate,
is
the
company
I
work
for
articulate.com
and
rise.rise.com
and
they're
trying
to
hire
like
50
devs
over
the
next
over
this
year.
Everything
from
engineering
managers
to-
I
guess
I
guess
yeah
I
wouldn't
be
qa
folks,
but
like
up
and
down
the
skill
level
stack.
So
if
you're
interested
give
me
a
shout
on
the
charleston
tech
slack
or
ask
tom,
but
yeah
I
figure.
B
B
Man,
I
was
using
react
on
the
server
in
like
2014
and
this
and
at
work.
No,
we
there's
nothing
on
the
server
now
to
be
to
be
fair,
there's
some
really
cool
stuff.
That's
not
this
that
you
can
that
you've
been
able
to
do
for
like
seven
years
with
rendering,
because
you
can
use
react
on
the
server
to
build
up
static,
html
and
send
that
down
to
the
client
the
big
cool
thing
back
in
the
day.
B
I
guess
people
still
do
this
now,
but
you
could
be
like
here's,
my
really
fast
h,
you
know
server
side
rendered
thing
and
then
you,
when
your
javascript
bundle
downloads
you
throw
that
on
top
of
you
know,
wherever
you
put
it
in
your
dom
and
so
it'd
give
you
the
page,
and
so
you
could,
you
know
theoretically
have
progressive
enhancements
where,
if
you,
if
you,
if
your
server
would
respond
to,
you
know
form
full
page
form
posts
and
all
that
kind
of
stuff.
B
C
B
C
It
kind
of
reminds
me
of
like
react.
Router
too,
it's
just
like
another.
You
know
even
further
behind
server,
now
ops
engineer,
my
team
would
have
a
meltdown
seeing
this
the
anti-javascript
crew.
A
Yeah,
I
I
think
you
could
actually
you
know
kind
of
compose
some.
You
know
like
terraform
templates
and
react
or
something
I
don't
know.
I
I
ran
across
that
project
and-
and
I
always
thought
that
you
know
react's,
declarative,
syntax
really
hits
a
lot
of
people
gives
them
some
really
good
dx
and
sometimes
when
you're
writing
apis
or
writing
business
logic,
you're
trying
to
find
where
that
parentheses
is
or
where
that
curly
braces
is
right
and
and
typescript
really
helps
a
lot.
A
But
but
this
could
even
I
don't
know,
maybe
take
it
a
step
further
or
or
just
be
a
nice
little
gimmick.
I
don't
know
we'll
see.
C
B
Yeah,
I
just
realized
too,
you've
made
a
declarative
like
server
set
up
instead,
so
instead
like
koa
and
express,
are
all
like
you
know,
like
app.used,
you
know
you're
mutating
something,
but
here
you're
just
describing
it
instead
of
telling
it
how
to
set
it
up.
It's
pretty
cool.
A
Yeah
cool
well
thanks.
Hopefully,
topics
like
this
are
of
interest,
but
if
you
have
something
else,
you
you
want
we're
going
to.
Try
to.
You
know,
try
to
make
the
the
presentations
being
something
interesting
and
not
just
you
know:
here's
another
cs
and
js
library
or
whatever.
A
But
please
let
me
know
what
you
want
to
hear
and
I'll
work
on
lining
up
speakers
and
if
you
would
like
to
share
a
15-minute
presentation
on
some
stuff
that
you're
finding
cool
with
react,
please
let
me
know
really
enjoy
this
stuff
and
look
forward
to
doing
it
next
time.
I'll
stick
on
the
line
if
anyone
else
wants
to
chat
but
other
than
that,
that's
that's
our
meetup
thanks
for
joining.
A
A
B
A
Sure
you
can't
hear
okay,
how
how
many
I
mean
mongodb
does
that
kind
of
fit
underneath
the
javascript
user
group
umbrella
yeah,
I
mean
we
can
talk
mongodb.
We
can
do
a
presentation
on
that.
If
that's
something.
A
A
C
Postgres
is
pretty
popular.
We
use
a
lot
of
my
sql
depending
on
the
service
we're
working
with
in
my
company.
We
got
a
lot
of
different
services
under
the
umbrella,
but
we
usually
use
like
my
sequel
like
when
working
with
like
wordpress.
A
Yeah
you
get
a
mix,
I
think
postgres
and
would
probably
be
the
two
most
popular
of
both
sql
and
no
sequel
would
be
my
guess.
But
but
it's
always
it's
always
good
to
see
people
working
with
data.
I
think
that's
a
good
topic
yeah.
I
was
just
gonna.
I've
just
been
so
blown
away
by
the
studio,
3p
product,
I've.
A
B
A
It's
I
I
kind
of
think
of
it
as
mike.
You
know
I
I
spent
you
know,
20
years
or
so
with
microsoft,
sql
server,
because
that's
the
only
database
erp
system,
I've
been
a
consultant
for
worked
on,
so
don't
have
any
don't
have
any
direct
experience
with
with
these
other.
These
other.
B
A
But
other
versions
of
sql
server,
but
our
other
versions
of
sql
products,
but
yeah,
it's
it's.
You
know
out
of
the
box
out
of
the
cloud.
I
guess
you
see
now
but
doesn't
have
I
don't.
I
don't
think
it
has
it.
It
doesn't
didn't,
provide
you
with
a
very
good
user
interface,
but
studio
3t
is
just
I
mean
it's,
it's
even
better.
I
I
I
find
it
even
more
helpful
than
like
query.
I
mean
the
microsoft
sql
console,
I
guess
postgres
and
all
these
a
lot
of
them
have
these
products.
These
third-party
products.
A
Where
you
can
you
can
build
these,
build
your
queries
and
work
with
your
data.
You
know
right
in
the
you
know,
right
in
the
plot
right
in
the
tool
rather
and
doesn't
provide
you
anything
anywhere
near
the
studio,
3t
level
but
yeah.
I
was
just
curious
if,
if
there
were
several
of
you
that
were
interested
in
I
or
that
used,
I
was
going
to
say,
I'd
be
happy
to
do
a
lightning
or
something
on
studio
3t.
But
again
from
a
from
a
newbies
point
of
view,
I
mean
all
you
guys.
A
Are
you
know
way
over?
I'm
a
hobbyist
programmer
in
my
retirement,
as
you
guys
tom
knows,
but
I've
just
been
so
blown
away
by
by
what's
in
studio,
3t
that
I,
if
there
was
by
chance
anybody
that
was
using
without
it
unless
they're
using
another
tool
that
takes
that
takes
the
place
of
studio.
3-2
really
has,
as
the
saying
goes,
it's
changed
my
life
as
far
as
writing.
A
Tell
you
what
yeah,
if
you
can
put
together
a
three
to
five
minute,
talk
on
it.
I
think
it
would
be
worth
sharing
so
yeah.
Just
do
that
and
I'll
I'll
make
a
note
and
pencil
again
for
next
month
and
yeah.
I
I
again,
I
think
everyone
you
know
comes
to
these
to
learn
something
new.
So
just
because
people
are
not
using
something
doesn't
mean
it's
worth
not
worth
sharing,
so
I
mean.
C
B
A
In
these
inquiries,
in
in
these
advanced
queries
that
we
used
to
do
in
stored
procedures
at
mungo,
really
I
mean
manga
didn't
have
store
procedures.
My
knowledge
and
I've
been
looking
for
something
that
allows
me
to
write
these
really
serious
queries
to
get
to
get
my
workload
done
on
the
server
rather
than
how
I
had
been
doing
it
prior
to
three
months
ago,
I'll
bring
this
giant
file
down
and
do
it
all
in.
A
You
know
javascript
on
the
client,
but
now
I
can
I
can
do
these
advanced
queries
on
the
on
the
server
and
that's
it's
helped
my
my
little
lap
a
little
civil
war
project,
and
I
think
it's
really
helped
me
a
lot
with
making
queries
that,
were
you
know,
work
on
the
server
as
opposed
to
downloading
these
massive
files,
like
I
was
doing
yeah.
C
That's
awesome
looks
like
a
nice
way
to
have
to
work
with
json,
so
anytime,
you
can
make
that
less
of
a
pain.
It's
always
cool
to
see
so
be
happy.
Yeah
check
it
out.