Skip to content
This repository was archived by the owner on Oct 7, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NODE_ENV=development
PORT=3000
NODE_ENV=
PORT=
MONGO_PATH=
MONGO_USER=
MONGO_PASSWORD=
JWT_SECRET=
JWT_SECRET=

5 changes: 2 additions & 3 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
tabWidth: 4,
singleQuote: true,
semi: true,
singleQuote: true,
semi: true,
};
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fa1b49",
"activityBar.background": "#fa1b49",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#155e02",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#e7e7e799",
"sash.hoverBorder": "#fa1b49",
"statusBar.background": "#dd0531",
"statusBar.border": "#dd0531",
"statusBar.debuggingBackground": "#05ddb1",
"statusBar.debuggingBorder": "#05ddb1",
"statusBar.debuggingForeground": "#15202b",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#fa1b49",
"statusBarItem.remoteBackground": "#dd0531",
"statusBarItem.remoteForeground": "#e7e7e7",
"tab.activeBorder": "#fa1b49",
"titleBar.activeBackground": "#dd0531",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.border": "#dd0531",
"titleBar.inactiveBackground": "#dd053199",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.color": "#dd0531"
}
269 changes: 269 additions & 0 deletions api.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
{
"info": {
"_postman_id": "d22c96a2-e8ff-43c7-bd90-cf34d1490c41",
"name": "Express-with-typescript",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "9624369"
},
"item": [
{
"name": "Auth",
"item": [
{
"name": "Signup",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.environment.set('token' , pm.response.json().token)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"firstName\" : \"{{$randomFirstName}}\",\r\n \"lastName\" : \"{{$randomLastName}}\",\r\n \"email\" : \"{{$randomEmail}}\",\r\n \"password\" : \"pass1234\",\r\n \"passwordConfirm\" : \"pass1234\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "/signup",
"path": [
"signup"
]
}
},
"response": []
},
{
"name": "Login",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\" : \"Lola.Nienow@hotmail.com\",\r\n \"password\" : \"{{PASSWORD}}\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "/login",
"path": [
"login"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const baseUrl =pm.collectionVariables.get('BASE_URL')",
"",
"console.log(baseUrl)",
"",
"pm.request.url = `${baseUrl}/auth${pm.request.url}`"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const baseUrl =pm.collectionVariables.get('BASE_URL')",
"",
"console.log(baseUrl)",
"",
"pm.request.url = `${baseUrl}/api/auth${pm.request.url}`"
]
}
}
]
},
{
"name": "Users",
"item": [
{
"name": "Get All Users",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "/",
"path": [
""
]
}
},
"response": []
},
{
"name": "Get User",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "/:id",
"path": [
":id"
],
"variable": [
{
"key": "id",
"value": "63343f3eca00d5cd92675969"
}
]
}
},
"response": []
},
{
"name": "Delete user",
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "/:id",
"path": [
":id"
],
"variable": [
{
"key": "id",
"value": "63343f3eca00d5cd92675969"
}
]
}
},
"response": []
},
{
"name": "Update User",
"request": {
"method": "PATCH",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"firstName\" : \"{{$randomFirstName}}\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "/:id",
"path": [
":id"
],
"variable": [
{
"key": "id",
"value": "63343f3eca00d5cd92675969"
}
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const baseUrl =pm.collectionVariables.get('BASE_URL')",
"",
"console.log('baseUrl' , baseUrl)",
"",
"pm.request.url = `${baseUrl}/users${pm.request.url}`"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const baseUrl =pm.collectionVariables.get('BASE_URL')",
"",
"console.log(baseUrl)",
"",
"pm.request.url = `${baseUrl}/auth${pm.request.url}`"
]
}
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "BASE_URL",
"value": "http://localhost:5000/api",
"type": "string"
},
{
"key": "PASSWORD",
"value": "pass1234",
"type": "string"
}
]
}
Loading