User Tools

Site Tools


node:node

This is an old revision of the document!


Table of Contents

NodeJS

Getting started

npm init
npm install pug
npm install fastify
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.1646943506.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki