node:node
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| node:node [2022/03/10 17:52] – [VSCode] utedass | node:node [2024/08/19 10:24] (current) – [Getting started] utedass | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== NodeJS ====== | ====== NodeJS ====== | ||
| + | ===== Terminology ===== | ||
| + | |||
| + | ^ Term ^ Description ^ | ||
| + | | react | Front-end framework | | ||
| + | | JSX | HTML-style coding in JS | | ||
| + | | fastify | Node framework for backend | | ||
| + | | HMR | Hot Module Replacement, | ||
| + | | Routing | Moving user to different pages | | ||
| + | ===== Libraries and frameworks ===== | ||
| + | |||
| + | ^ Name ^ Category ^ Description ^ | ||
| + | | vite | Build environment? | ||
| + | | react | Front-end framework | Uses JSX and has a lot of other stuff | | ||
| + | | MUI | Components | Front end component and layout framework | | ||
| + | | bootstrap | Components | Front end component and layout framework | | ||
| + | |||
| + | |||
| + | ===== VS Code ===== | ||
| + | |||
| + | ^ Plugin name ^ Description ^ | ||
| + | | Prettier - Code formatter | ||
| + | | ES7+ React/ | ||
| + | | indent-rainbow | Easier to read indents | | ||
| + | |||
| + | ^ Hotkey ^ Description ^ | ||
| + | | c-d | Find similar word and enter multi-cursor edit mode, press multiple times | | ||
| + | | | | | ||
| + | | | | | ||
| + | |||
| + | ===== Resources ===== | ||
| + | |||
| + | ^ Link ^ Description ^ | ||
| + | | [[https:// | ||
| + | | [[http:// | ||
| + | ===== Getting started ===== | ||
| + | |||
| + | <code bash> | ||
| + | npm create vite@latest | ||
| + | </ | ||
| + | Follow the guide. Pick for example react with JavaScript + SWC | ||
| + | |||
| + | Then run | ||
| + | <code bash> | ||
| + | cd proj-dir | ||
| + | npm install | ||
| + | npm run dev | ||
| + | </ | ||
| + | |||
| + | ===== Getting started | ||
| + | |||
| + | <code bash> | ||
| + | npm init | ||
| + | npm install pug | ||
| + | npm install fastify | ||
| + | npm install fastify-pug # Nope | ||
| + | </ | ||
| + | |||
| + | <code javascript> | ||
| + | import Fastify from " | ||
| + | |||
| + | // Fastify instance | ||
| + | const fastify = Fastify({logger: | ||
| + | |||
| + | |||
| + | fastify.get("/", | ||
| + | res.send( " | ||
| + | } ) | ||
| + | |||
| + | |||
| + | try{ | ||
| + | await fastify.listen({port: | ||
| + | }catch(err){ | ||
| + | console.log(err); | ||
| + | process.exit(1); | ||
| + | } | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | <code javascript> | ||
| + | // | ||
| + | //Add: | ||
| + | |||
| + | " | ||
| + | </ | ||
| ===== VSCode ===== | ===== VSCode ===== | ||
node/node.1646934727.txt.gz · Last modified: 2022/09/12 00:30 (external edit)
