Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,256 changes: 1,256 additions & 0 deletions modulo5/intro-express/package-lock.json

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions modulo5/intro-express/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "intro-express",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "tsc && node./build/index.js",
"build": "tsc"
},
"author": "",
"license": "ISC",
"dependencies": {
"@types/node": "^18.11.7",
"express": "^4.18.2",
"tsc": "^2.0.4",
"typescript": "^4.8.4"
},
"devDependencies": {
"@types/cors": "^2.8.12",
"@types/express": "^4.17.14",
"cors": "^2.8.5"
},
"keywords": [],
"description": ""
}
19 changes: 19 additions & 0 deletions modulo5/intro-express/src/Exercicio1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import express, {Request, Response} from "express"

import cors from 'cors'

const app = express()

app.use(express.json())

app.use(cors())

app.listen(3003, () => {
console.log("Servidor executando na porta 3003");
});

app.get("teste/id", (req: Request, res: Response)=>{
const id = req.params.id
const pasword = req.headers. pasword
const name = req.body
})
17 changes: 17 additions & 0 deletions modulo5/intro-express/src/Exercicio2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import express from "express"

import cors from 'cors'

const app = express()

app.use(express.json())

app.use(cors())

app.listen(3003, () => {
console.log("Server is running in http://localhost:3003");
});

app.get("/", (req: any, res: { send: (arg0: string) => void }) => {
res.send("Hello from Express")
})
88 changes: 88 additions & 0 deletions modulo5/intro-express/src/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

type usuarios = {
id: number,
name: string,
phone: number,
email: string
website: string
}


type posts = {
id: Number,
title: string,
body: string,
userId: Number
}


export const users = [

{
id:1,
name: "Fagner Fontes",
phone: 12345667,
email: "fontesbatista@gmail.com",
website: "fontes.com.br"
},

{
id:1,
name: "Jack Fontes",
phone: 12345787,
email: "fontesbatista@gmail.com",
website: "fontes.com.br"
},

{
id:1,
name: "Ellen Fontes",
phone: 125345787,
email: "fontesbatista@gmail.com",
website: "fontes.com.br"
},

{
id:1,
name: "Esme Fontes",
phone: 1253457897,
email: "fontesbatista@gmail.com",
website: "fontes.com.br"
}

]

export const posts = [
{
id:1,
title: "verdade",
body: "A verdade está la fora",
userId: 78

},

{
id:2,
title: "A bolha",
body: "Para quem vive dentro dela",
userId: 12558

},
{
id:3,
title: "Vedade3 ",
body: "Para quem vive fora dela",
userId: 1254

},

{
id:5,
title: "A bolha2",
body: "Para quem vive dentro e fora dela",
userId: 455

}


]
15 changes: 15 additions & 0 deletions modulo5/intro-express/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version */
"module": "commonjs", /* Specify module code generation */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./build", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. */
"removeComments": true, /* Do not emit comments to output. */
"strict": true,
"esModuleInterop": true,
"skipDefaultLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true /* Raise error on declarations with an implied 'any' type. */
}
}
Empty file.
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions modulo5/lista-typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "lista-typescript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
4 changes: 4 additions & 0 deletions modulo7/testes-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
.DS_STORE
node_modules
build
Loading