lesson 3 and 4
This commit is contained in:
25
nodeJS/Learning/03/src/index.ts
Normal file
25
nodeJS/Learning/03/src/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config({ path: `${__dirname}/../.env` });
|
||||
|
||||
import express from 'express';
|
||||
const app = express();
|
||||
const port = process.env.PORT || 3000; //usually above >1000 is unoccupied
|
||||
|
||||
//ftp: 21
|
||||
//http: 80 (common practice to use those numbers) (standard website, but scamming)
|
||||
//https: 443
|
||||
|
||||
//GET, POST, PUT, DELETE (standard protocols)
|
||||
//GET = Read (get data from website and send back)
|
||||
//POST = Create
|
||||
//PUT = Update
|
||||
//DELETE
|
||||
|
||||
app.get(`/`, (req, res) => {
|
||||
res.send("Tiffany's Website is under Construction. Come back later.");
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running on http://localhost:${port}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user