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 change: 1 addition & 0 deletions modulo5/aprofundamento-express/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4,024 changes: 4,024 additions & 0 deletions modulo5/aprofundamento-express/package-lock.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions modulo5/aprofundamento-express/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "aprofundamento-express",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start:dev": "ts-node-dev ./src/index.ts",
"start": "nodemon src/index.ts",
"build": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@types/express": "^4.17.13",
"@types/node": "^17.0.38",
"express": "^4.18.1",
"ts-node-dev": "^2.0.0",
"typescript": "^4.7.2"
},
"devDependencies": {
"@types/uuid": "^8.3.4",
"nodemon": "^2.0.16",
"ts-node": "^10.8.0",
"uuid": "^8.3.2"
}
}
Empty file.
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions modulo5/aprofundamento-express/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import express from "express";

import { AddressInfo } from "net";

const app = express();

app.use(express.json());

const server = app.listen(process.env.PORT || 3003, () => {
if (server) {
const address = server.address() as AddressInfo;
console.log(`Server is running in http://localhost:${address.port}`);
} else {
console.error(`Failure upon starting server.`);
}
});;
11 changes: 11 additions & 0 deletions modulo5/aprofundamento-express/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"outDir": "./build" /* Redirect output structure to the directory. */,
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
"strict": true /* Enable all strict type-checking options. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}