Skip to content
Snippets Groups Projects
Commit 2e78a055 authored by Noel Simbolon's avatar Noel Simbolon
Browse files
parents a5a0b8e0 b7cb7b7e
No related merge requests found
# This was inserted by `prisma init`:
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
APP_PORT=3001
DB_HOST=db_tonality_rest
DBMS=postgresql#if you use another dbms, change at prisma/schema.prisma too
DB_USER=
DB_PASSWORD=
DB_NAME=
DB_PORT=
DATABASE_URL="${DBMS}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=public&pgbouncer=true&connection_limit=1&pool_timeout=20"
# This was inserted by `prisma init`:
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
APP_PORT=3001
DB_HOST=localhost
DBMS=postgresql#if you use another dbms, change at prisma/schema.prisma too
DB_USER=
DB_PASSWORD=
DB_NAME=
DB_PORT=
DATABASE_URL="${DBMS}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=public&pgbouncer=true&connection_limit=1&pool_timeout=20"
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
dist
node_modules
.env
\ No newline at end of file
This diff is collapsed.
{
"name": "tonality-rest",
"version": "1.0.0",
"description": "",
"main": "dist/app.js",
"scripts": {
"start": "tsc && node dist/app.js",
"lint": "eslint . --ext .ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/express": "^4.17.1",
"@types/jest": "^29.5.6",
"@types/supertest": "^2.0.15",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint": "^8.52.0",
"jest": "^29.7.0",
"prisma": "^5.4.2",
"supertest": "^6.3.3",
"typescript": "^5.2.2",
"zod": "^3.22.4"
},
"dependencies": {
"@prisma/client": "^5.4.2",
"@types/bcrypt": "^5.0.1",
"@types/jsonwebtoken": "^9.0.4",
"bcrypt": "^5.1.1",
"dotenv": "^16.3.1",
"express": "^4.17.1",
"ts-node": "^10.9.1"
}
}
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
npm i;
npx prisma migrate dev;
npx prisma generate;
\ No newline at end of file
import express from 'express';
import {z} from 'zod';
import dotenv from 'dotenv';
dotenv.config();
const app = express();
const port = process.env.APP_PORT;
app.get('/', (req, res) => {
res.send(
{
message: 'Hello World!',
}
);
});
app.listen(port, () => {
return console.log(`Express is listening at http://localhost:${port}`);
});
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"strict": true,
},
"lib": ["es2015"]
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment