This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const userRoutes = require('./routes/users'); | |
const app = express(); | |
const someValue = 'foo bar'; | |
app.get('/', function (req, res) { | |
// Rendering server-side can simply return an HTML string, either directly or from a template lib. | |
// Note that it's usually discouraged to put a whole template right in the main app - use a separate file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function () { | |
// Grab a couple elements from the DOM | |
const button = document.querySelector('button'); | |
const main = document.querySelector('main'); | |
// Pull some data from an element | |
const originalColour = button.style.backgroundColor; | |
// Make a new Node, where we can put our results | |
const results = document.createElement('p'); | |
main.appendChild(results); | |