diff --git a/semana19/criptografia/package.json b/semana19/criptografia/package.json new file mode 100644 index 0000000..97975c9 --- /dev/null +++ b/semana19/criptografia/package.json @@ -0,0 +1,28 @@ +{ + "name": "aula-back-arquitetura", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "ts-node-dev ./src/index.ts", + "build": "tsc" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@types/express": "4.17.0", + "@types/jsonwebtoken": "^8.3.9", + "@types/knex": "^0.16.1", + "@types/node": "^13.7.7", + "@types/uuid": "^7.0.3", + "dotenv": "^8.2.0", + "express": "4.17.0", + "jsonwebtoken": "^8.5.1", + "knex": "^0.21.1", + "mysql": "^2.18.1", + "ts-node": "^8.6.2", + "ts-node-dev": "^1.0.0-pre.44", + "typescript": "^3.8.3", + "uuid": "^8.0.0" + } +} diff --git a/semana19/criptografia/src/index.ts b/semana19/criptografia/src/index.ts new file mode 100644 index 0000000..65d6d66 --- /dev/null +++ b/semana19/criptografia/src/index.ts @@ -0,0 +1,18 @@ +import express, { Request, Response } from "express"; +import dotenv from "dotenv"; +import { AddressInfo } from "net"; + +dotenv.config(); + +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.`); + } +}); diff --git a/semana19/criptografia/tsconfig.json b/semana19/criptografia/tsconfig.json new file mode 100644 index 0000000..b520b3a --- /dev/null +++ b/semana19/criptografia/tsconfig.json @@ -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": "./" /* 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. */ + } +}