Skip to content

Commit

Permalink
2o mss calendario
Browse files Browse the repository at this point in the history
  • Loading branch information
luisgmunhoz committed Jun 1, 2023
1 parent 0821c4b commit f60c088
Show file tree
Hide file tree
Showing 10 changed files with 2,369 additions and 0 deletions.
6 changes: 6 additions & 0 deletions calendar/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PG_HOST=
PG_PORT=
PG_USER=
PG_PASSWORD=
PG_DATABASE=
SECRET_KEY=
130 changes: 130 additions & 0 deletions calendar/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
21 changes: 21 additions & 0 deletions calendar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microserviço de autenticação

## Descrição

# Ao clonar o repositorio, execute o comando abaixo para instalar as dependencias

```
npm install
```

# Para executar o projeto, execute o comando abaixo

```
npm start
```

ou

```
npm run dev
```
5 changes: 5 additions & 0 deletions calendar/TESTE.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SET DATESTYLE TO POSTGRES, DMY ;
DROP TABLE IF EXISTS appointments CASCADE ;

CREATE TABLE appointments(user_id SERIAL PRIMARY KEY, title VARCHAR(500), "date" DATE NOT NULL);
INSERT INTO appointments VALUES(DEFAULT,'fazer cafÉ', current_date)
13 changes: 13 additions & 0 deletions calendar/configs/database.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client } from "pg";
import dotenv from "dotenv";
dotenv.config();

const client = new Client({
host: process.env.PG_HOST,
port: Number(process.env.PG_PORT),
user: process.env.PG_USER,
password: process.env.PG_PASSWORD,
database: process.env.PG_DATABASE,
});

export default client;
5 changes: 5 additions & 0 deletions calendar/configs/dotenv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (process.env.NODE_ENV !== "production") {
import("dotenv").then((dotenv) => {
dotenv.config(); // Configuring dotenv during development
});
}
Loading

0 comments on commit f60c088

Please sign in to comment.