-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4818b9b
commit 6513cba
Showing
26 changed files
with
848 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
import express from 'express'; | ||
import express from 'express' | ||
// morgan sirve para ver las peticiones a la api cuando esta corriendo el servidor en la consola | ||
import morgan from 'morgan'; | ||
import dotenv from 'dotenv'; | ||
import morgan from 'morgan' | ||
import dotenv from 'dotenv' | ||
// sirve para comunicarnos con otros tipos de servidores de desarrollo | ||
import cors from 'cors'; | ||
import passport from 'passport'; | ||
import passportMiddleware from './middlewares/passport'; | ||
import routes from './routes'; | ||
import path from 'path'; | ||
import { config } from './config/config'; | ||
import cors from 'cors' | ||
import passport from 'passport' | ||
import passportMiddleware from './middlewares/passport' | ||
import routes from './routes' | ||
import path from 'path' | ||
import { config } from './config/config' | ||
|
||
// initializations | ||
const app = express(); | ||
dotenv.config(); | ||
const app = express() | ||
dotenv.config() | ||
|
||
const port = config.PORT; | ||
const port = config.PORT | ||
// settings | ||
app.set('port', port); | ||
app.set('port', port) | ||
|
||
// middleware | ||
|
||
app.use(morgan('dev')); | ||
app.use(morgan('dev')); | ||
app.use(cors()); | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: false })); | ||
app.use(express.static(path.join(__dirname, 'uploads'))); | ||
app.use(passport.initialize()); | ||
passport.use(passportMiddleware); | ||
app.use(morgan('dev')) | ||
app.use(morgan('dev')) | ||
app.use(cors()) | ||
app.use(express.json()) | ||
app.use('/uploads', express.static(path.join(__dirname, 'uploads'))) | ||
app.use(express.urlencoded({ extended: false })) | ||
// app.use(express.static(path.join(__dirname, 'uploads'))); | ||
app.use(passport.initialize()) | ||
passport.use(passportMiddleware) | ||
|
||
// routes | ||
app.get('/', (req, res) => { | ||
res.send(`Welcome to ${config.APP_NAME}`); | ||
}); | ||
res.send(`Welcome to ${config.APP_NAME}`) | ||
}) | ||
|
||
app.use(routes); | ||
app.use(routes) | ||
|
||
export default app; | ||
export default app |
15 changes: 15 additions & 0 deletions
15
src/database/prisma/migrations/20231012151220_add_description_in_user_model/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `veterinarian` on the `MedicalRecord` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "MedicalRecord" DROP COLUMN "veterinarian", | ||
ADD COLUMN "vetId" TEXT; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "description" TEXT; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "MedicalRecord" ADD CONSTRAINT "MedicalRecord_vetId_fkey" FOREIGN KEY ("vetId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; |
12 changes: 12 additions & 0 deletions
12
src/database/prisma/migrations/20231013120342_add_data_in_user/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
Warnings: | ||
- The `status` column on the `PetVaccine` table would be dropped and recreated. This will lead to data loss if there is data in the column. | ||
*/ | ||
-- CreateEnum | ||
CREATE TYPE "VaccineStatus" AS ENUM ('DONE', 'PENDING', 'NOT_APPLICABLE'); | ||
|
||
-- AlterTable | ||
ALTER TABLE "PetVaccine" DROP COLUMN "status", | ||
ADD COLUMN "status" "VaccineStatus" NOT NULL DEFAULT 'PENDING'; |
11 changes: 11 additions & 0 deletions
11
src/database/prisma/migrations/20231029030138_add_created_by_pets/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `title` to the `MedicalRecord` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "MedicalRecord" ADD COLUMN "title" TEXT NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Pet" ADD COLUMN "createdBy" TEXT; |
2 changes: 2 additions & 0 deletions
2
src/database/prisma/migrations/20231029205130_add_qrcode_in_pet/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "Pet" ADD COLUMN "qrCode" TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.