►
From YouTube: hyper Web CMS API (hacking)
Description
In this video, Tom Wilson is working on the Update Feature for the FAQs API to drive the FAQ questions in the hyper website.
FYI, don't build a CMS with hyper, this is just an example for exercise purposes.
B
A
Ahead
and
record
this
mainly
for
trip
so
that
we
can
sort
of
stay
in
sync
with
what
we're
working
on.
So
I've
pulled
up
the
project
and
want
to
make
sure.
A
A
That's
better
so
let's
create
a
test
and
we're
gonna
do
put
faq
and
then
we'll
call
it
test.js
and
we're
going
to
need
tape.
A
And
we're
going
to
need
test
server.
A
B
A
B
A
A
I
just
I
can't
get
away
from
them
and
I
can't
use
them.
A
A
Vs
code,
it
just
felt
more
for
me,
so
where
were
we?
We
were
on
our
test
doing
put
okay
now,
we've
got
a
put
method
and
headers
and
name
content
type.
B
A
A
And
then
we
can
do
server
dot
close
and
we
can
do
test
plan.
A
Okay,
so
invalid
json
response
reason
expected,
so
it
sent
a
response
in
html,
not
json.
That's
one
thing
we
can
handle
on.
B
A
A
A
A
Work,
let's.
B
A
B
A
A
A
A
A
A
Like
so,
and
because
our
middleware,
we
got
a
core
from
the
quest
and
what
we
can
take
even
further
is
destructure.
This
request
up
here
to
just
what
we
need,
so
we
need
core
and
we
need
params
and
we
need
body
right,
pretty
cool
and
then
from
core.
A
A
That
should
be
our
endpoint
and
if
we
run
our
test
again
now,
I've
got
a
typo.
B
A
A
So
we've
got
an
id
and
an
faq.
A
Chain
so
I'm
going
to
say,
services,
dot,
update
and
we'll
give
it
an
id
and
an
faaq
like
that.
A
Now
we
probably
want
to
validate
the
faq
and
since
we're
hiding
type,
we
probably
want
to
deal
with
that
too.
So
we'll
start
the
chain
with
the
sync
of
faq
and
then
we'll
validate.
A
Defaults-
and
in
this
case,
though,
we
want
to
add
type,
but
we
don't
want
to
add
created
unless
it
already
exists
and
we
probably
want
to
add
updated
timestamp.
A
A
Verify
and
then
verify
returns
and
either
so
we'll
change
that
to
a
sync.
A
A
A
Cool
so
this
time
we
got
back
a
and
a
sink
which,
which
is
good,
and
we
just
need
to
convert
it
to
a
promise.
So
we'll
go
back
to
our
api.
A
A
A
In
our
index,
we've
got
to
create
a
get:
let's
create
an
update,
it's
going
to
take
an
id
and
a
doc.
It's
all
general
there's
nothing
about
faqs
here,
so
we're
gonna
do
a
sync
fetch
and
again
we're
call
in
side
effect
code,
but
it
doesn't
get
executed
until
that
two
promise
runs
on
the
the
api
layer.
A
A
Okay,
cool
and
then
we
need
a
body.