A Straightforward Guide to Back-End JavaScript
This is how you get data to a user.
Unless you want a static site, you need some way of reading/writing/updating user data. This is commonly built using a back-end/front-end framework.
Front-end frameworks attract most of the headlines. If you’ve heard of Vue, React, UIKit, Nuxt…these are all front-end frameworks (or libraries). But these need back-end data in order to be useful.
The structure will typically look something like this:
The focus of this article will be on the yellow part and the lavender part.
While it’s not the only stack to use, I’ll show you how to set up a backend stack using the following framework:
For this back-end we’ll be focusing on returning JSON data. For example, if we want to get a user, we can perform the following query (using the CURL command line):
$ curl -X GET http://example.com/users/1
{
"id": 4,
"username": "johnsmith",
"email": "john@example.com",
}
$…