Express quick start
Created: 2020-09-30 21:02:24 -0700 Modified: 2020-09-30 21:09:55 -0700
Background
Section titled BackgroundThis note is just for me to remember how to set up a really quick web server that can run JavaScript on the server based on a client’s request.
- Follow the getting-started guide
- It’s pretty much the following:
- yarn init -y
- yarn add express
- npx express-generator
- Write your code in whatever file you want, e.g. serverside.js. Make sure to export functions that you want to use.
- Add this code to app.js:
- Make index.jade look something like this:
- Start the server with something like this: