mirror of
https://github.com/myfatemi04/wheelshare-old-backend.git
synced 2025-04-21 12:10:17 -04:00
feat: added .env and changed tsconfig
This commit is contained in:
parent
425a03914e
commit
e15ef4f453
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
|
.env
|
|
@ -23,6 +23,7 @@
|
||||||
"@types/express": "^4.17.11",
|
"@types/express": "^4.17.11",
|
||||||
"@types/node": "^14.14.37",
|
"@types/node": "^14.14.37",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
"dotenv": "^8.2.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"typescript": "^4.2.4"
|
"typescript": "^4.2.4"
|
||||||
}
|
}
|
||||||
|
|
4
src/.env.sample
Normal file
4
src/.env.sample
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
NODE_ENV='dev'
|
||||||
|
APP_PORT=3000
|
||||||
|
DB_USER=
|
||||||
|
DB_PASS=
|
17
src/index.ts
17
src/index.ts
|
@ -1,6 +1,10 @@
|
||||||
import * as express from "express";
|
import express from "express";
|
||||||
import { users } from "./data";
|
import dotenv from 'dotenv';
|
||||||
import { groups } from "./data";
|
import { users, groups } from "./data";
|
||||||
|
|
||||||
|
dotenv.config({
|
||||||
|
path: '.env'
|
||||||
|
});
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
@ -24,7 +28,6 @@ app.delete('/user', (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
app.get("/pool", (req, res) => {
|
app.get("/pool", (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -41,7 +44,6 @@ app.delete('/pool', (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
app.get("/group", (req, res) => {
|
app.get("/group", (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -61,7 +63,6 @@ app.delete('/group', (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
app.get("/join_pool", (req, res) => {
|
app.get("/join_pool", (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -78,4 +79,6 @@ app.delete('/join_pool', (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(80, () => void console.log("Listening on port 80"));
|
((port = process.env.APP_PORT || 5000) => {
|
||||||
|
app.listen(port, () => void console.log(`Listening on port ${port}`));
|
||||||
|
})();
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist/",
|
"outDir": "dist/",
|
||||||
|
"esModuleInterop": true,
|
||||||
},
|
},
|
||||||
"files": ["src/types.ts"],
|
"files": ["src/types.ts"],
|
||||||
"include": ["src/"],
|
"include": ["src/"],
|
||||||
|
|
|
@ -150,6 +150,11 @@ destroy@~1.0.4:
|
||||||
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
|
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
|
||||||
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
|
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
|
||||||
|
|
||||||
|
dotenv@^8.2.0:
|
||||||
|
version "8.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
|
||||||
|
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
|
||||||
|
|
||||||
ee-first@1.1.1:
|
ee-first@1.1.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user