node:node
This is an old revision of the document!
Table of Contents
NodeJS
Terminology
| Term | Description |
|---|---|
| react | Front-end framework |
| JSX | HTML-style coding in JS |
| fastify | Node framework for backend |
Getting started
npm init npm install pug npm install fastify npm install fastify-pug # Nope
import Fastify from "fastify"; // Fastify instance const fastify = Fastify({logger:true}); fastify.get("/", (req, res)=>{ res.send( "HelloWorld" ) } ) try{ await fastify.listen({port:3000, host: "127.0.0.1"}); // Start server process, wait for it to exit }catch(err){ console.log(err); process.exit(1); }
//package.json //Add: "type": "module",
VSCode
| Command | Function |
|---|---|
c-P | Open all commands |
c-p | Search for files in project |
c-F | Search in code |
c-, | Settings |
node/node.1662942654.txt.gz · Last modified: 2022/09/12 00:30 by 127.0.0.1
