diff --git a/.dockerignore b/.dockerignore index 5e5e2ad..233c7bf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,7 +3,6 @@ # Show only the files we need !src/ -!test/ !package.json !package-lock.json !tsconfig.json diff --git a/Dockerfile b/Dockerfile index 7f3a5e9..3aef929 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,6 @@ FROM setup as build COPY ./src ./src RUN npm run build - EXPOSE 8000 diff --git a/deploy/ec2.tf b/deploy/ec2.tf index cfa5fd0..4263a07 100644 --- a/deploy/ec2.tf +++ b/deploy/ec2.tf @@ -9,8 +9,31 @@ is the easiest resource to create in AWS, and will only need: ################################################### # SETUP SCRIPT - Configure EC2 Server for Project # ################################################### -# TODO: Import setup script -# TODO: Pass in necessary env variables +data "aws_ami" "amzn_linux_2" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn2-ami-kernel-5.10-hvm-2.*"] + } + + filter { + name = "architecture" + values = ["x86_64"] + } +} + +resource "aws_instance" "jukebox_server" { + ami = data.aws_ami.amzn_linux_2.id + instance_type = "t3.micro" + user_data = file("./templates/ec2/server-setup.sh") + + tags = merge( + local.common_tags, + tomap({ Name = "${local.prefix}-server" }) + ) +} ########################################## # EC2 INSTANCE - Host Server Application # diff --git a/deploy/main.tf b/deploy/main.tf index 7ae7510..34f5a91 100644 --- a/deploy/main.tf +++ b/deploy/main.tf @@ -9,7 +9,7 @@ terraform { } provider "aws" { - region = "us-east-1" + region = "us-east-2" } locals { diff --git a/deploy/templates/ec2/server-setup.sh b/deploy/templates/ec2/server-setup.sh index 152d5ab..94b8a1e 100644 --- a/deploy/templates/ec2/server-setup.sh +++ b/deploy/templates/ec2/server-setup.sh @@ -1,9 +1,19 @@ #!/bin/sh -# SETUP SCRIPT - Used to set up EC2 Server - set -e -# TODO: Install docker -# TODO: Install docker-compose -# TODO: Pull image from Docker Hub -# TODO: Build and run project with compose \ No newline at end of file +sudo yum update -y + +sudo amazon-linux-extras install -y docker +sudo systemctl enable docker.service +sudo systemctl start docker.service + +sudo yum install docker-compose + +sudo usermod -aG docker ec2-user # Add user to "docker" group for permissions + +sudo yum install git +git clone https://github.com/ufosc/Jukebox-Server.git + +docker-compose -f ./Jukebox-Server/docker-compose.yml build +docker-compose -f ./Jukebox-Server/docker-compose.yml up -d + diff --git a/package-lock.json b/package-lock.json index 800f7a5..08488b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "dotenv": "^16.0.3", "express": "^4.18.2", "jsonwebtoken": "^9.0.2", + "module-alias": "^2.2.3", "mongoose": "^7.5.2", "pg": "^8.10.0", "querystring": "^0.2.1", @@ -31,6 +32,7 @@ "@types/jest": "^29.5.5", "@types/jsonwebtoken": "^9.0.5", "@types/mocha": "^10.0.1", + "@types/module-alias": "^2.0.4", "@types/pg": "^8.6.6", "@types/request": "^2.48.10", "@types/supertest": "^2.0.14", @@ -41,6 +43,7 @@ "chai-http": "^4.3.0", "child_process": "^1.0.2", "dedent-js": "^1.0.1", + "esbuild": "^0.20.0", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-config-standard-with-typescript": "^43.0.1", @@ -842,6 +845,374 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.0.tgz", + "integrity": "sha512-fGFDEctNh0CcSwsiRPxiaqX0P5rq+AqE0SRhYGZ4PX46Lg1FNR6oCxJghf8YgY0WQEgQuh3lErUFE4KxLeRmmw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.0.tgz", + "integrity": "sha512-3bMAfInvByLHfJwYPJRlpTeaQA75n8C/QKpEaiS4HrFWFiJlNI0vzq/zCjBrhAYcPyVPG7Eo9dMrcQXuqmNk5g==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.0.tgz", + "integrity": "sha512-aVpnM4lURNkp0D3qPoAzSG92VXStYmoVPOgXveAUoQBWRSuQzt51yvSju29J6AHPmwY1BjH49uR29oyfH1ra8Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.0.tgz", + "integrity": "sha512-uK7wAnlRvjkCPzh8jJ+QejFyrP8ObKuR5cBIsQZ+qbMunwR8sbd8krmMbxTLSrDhiPZaJYKQAU5Y3iMDcZPhyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.0.tgz", + "integrity": "sha512-AjEcivGAlPs3UAcJedMa9qYg9eSfU6FnGHJjT8s346HSKkrcWlYezGE8VaO2xKfvvlZkgAhyvl06OJOxiMgOYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.0.tgz", + "integrity": "sha512-bsgTPoyYDnPv8ER0HqnJggXK6RyFy4PH4rtsId0V7Efa90u2+EifxytE9pZnsDgExgkARy24WUQGv9irVbTvIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.0.tgz", + "integrity": "sha512-kQ7jYdlKS335mpGbMW5tEe3IrQFIok9r84EM3PXB8qBFJPSc6dpWfrtsC/y1pyrz82xfUIn5ZrnSHQQsd6jebQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.0.tgz", + "integrity": "sha512-uG8B0WSepMRsBNVXAQcHf9+Ko/Tr+XqmK7Ptel9HVmnykupXdS4J7ovSQUIi0tQGIndhbqWLaIL/qO/cWhXKyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.0.tgz", + "integrity": "sha512-2ezuhdiZw8vuHf1HKSf4TIk80naTbP9At7sOqZmdVwvvMyuoDiZB49YZKLsLOfKIr77+I40dWpHVeY5JHpIEIg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.0.tgz", + "integrity": "sha512-uTtyYAP5veqi2z9b6Gr0NUoNv9F/rOzI8tOD5jKcCvRUn7T60Bb+42NDBCWNhMjkQzI0qqwXkQGo1SY41G52nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.0.tgz", + "integrity": "sha512-c88wwtfs8tTffPaoJ+SQn3y+lKtgTzyjkD8NgsyCtCmtoIC8RDL7PrJU05an/e9VuAke6eJqGkoMhJK1RY6z4w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.0.tgz", + "integrity": "sha512-lR2rr/128/6svngnVta6JN4gxSXle/yZEZL3o4XZ6esOqhyR4wsKyfu6qXAL04S4S5CgGfG+GYZnjFd4YiG3Aw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.0.tgz", + "integrity": "sha512-9Sycc+1uUsDnJCelDf6ZNqgZQoK1mJvFtqf2MUz4ujTxGhvCWw+4chYfDLPepMEvVL9PDwn6HrXad5yOrNzIsQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.0.tgz", + "integrity": "sha512-CoWSaaAXOZd+CjbUTdXIJE/t7Oz+4g90A3VBCHLbfuc5yUQU/nFDLOzQsN0cdxgXd97lYW/psIIBdjzQIwTBGw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.0.tgz", + "integrity": "sha512-mlb1hg/eYRJUpv8h/x+4ShgoNLL8wgZ64SUr26KwglTYnwAWjkhR2GpoKftDbPOCnodA9t4Y/b68H4J9XmmPzA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.0.tgz", + "integrity": "sha512-fgf9ubb53xSnOBqyvWEY6ukBNRl1mVX1srPNu06B6mNsNK20JfH6xV6jECzrQ69/VMiTLvHMicQR/PgTOgqJUQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.0.tgz", + "integrity": "sha512-H9Eu6MGse++204XZcYsse1yFHmRXEWgadk2N58O/xd50P9EvFMLJTQLg+lB4E1cF2xhLZU5luSWtGTb0l9UeSg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.0.tgz", + "integrity": "sha512-lCT675rTN1v8Fo+RGrE5KjSnfY0x9Og4RN7t7lVrN3vMSjy34/+3na0q7RIfWDAj0e0rCh0OL+P88lu3Rt21MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.0.tgz", + "integrity": "sha512-HKoUGXz/TOVXKQ+67NhxyHv+aDSZf44QpWLa3I1lLvAwGq8x1k0T+e2HHSRvxWhfJrFxaaqre1+YyzQ99KixoA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.0.tgz", + "integrity": "sha512-GDwAqgHQm1mVoPppGsoq4WJwT3vhnz/2N62CzhvApFD1eJyTroob30FPpOZabN+FgCjhG+AgcZyOPIkR8dfD7g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.0.tgz", + "integrity": "sha512-0vYsP8aC4TvMlOQYozoksiaxjlvUcQrac+muDqj1Fxy6jh9l9CZJzj7zmh8JGfiV49cYLTorFLxg7593pGldwQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.0.tgz", + "integrity": "sha512-p98u4rIgfh4gdpV00IqknBD5pC84LCub+4a3MO+zjqvU5MVXOc3hqR2UgT2jI2nh3h8s9EQxmOsVI3tyzv1iFg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.0.tgz", + "integrity": "sha512-NgJnesu1RtWihtTtXGFMU5YSE6JyyHPMxCwBZK7a6/8d31GuSo9l0Ss7w1Jw5QnKUawG6UEehs883kcXf5fYwg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1837,6 +2208,12 @@ "integrity": "sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w==", "dev": true }, + "node_modules/@types/module-alias": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/module-alias/-/module-alias-2.0.4.tgz", + "integrity": "sha512-5+G/QXO/DvHZw60FjvbDzO4JmlD/nG5m2/vVGt25VN1eeP3w2bCoks1Wa7VuptMPM1TxJdx6RjO70N9Fw0nZPA==", + "dev": true + }, "node_modules/@types/node": { "version": "20.11.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", @@ -3992,6 +4369,44 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.0.tgz", + "integrity": "sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.0", + "@esbuild/android-arm": "0.20.0", + "@esbuild/android-arm64": "0.20.0", + "@esbuild/android-x64": "0.20.0", + "@esbuild/darwin-arm64": "0.20.0", + "@esbuild/darwin-x64": "0.20.0", + "@esbuild/freebsd-arm64": "0.20.0", + "@esbuild/freebsd-x64": "0.20.0", + "@esbuild/linux-arm": "0.20.0", + "@esbuild/linux-arm64": "0.20.0", + "@esbuild/linux-ia32": "0.20.0", + "@esbuild/linux-loong64": "0.20.0", + "@esbuild/linux-mips64el": "0.20.0", + "@esbuild/linux-ppc64": "0.20.0", + "@esbuild/linux-riscv64": "0.20.0", + "@esbuild/linux-s390x": "0.20.0", + "@esbuild/linux-x64": "0.20.0", + "@esbuild/netbsd-x64": "0.20.0", + "@esbuild/openbsd-x64": "0.20.0", + "@esbuild/sunos-x64": "0.20.0", + "@esbuild/win32-arm64": "0.20.0", + "@esbuild/win32-ia32": "0.20.0", + "@esbuild/win32-x64": "0.20.0" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -7657,6 +8072,11 @@ "node": ">=10" } }, + "node_modules/module-alias": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.3.tgz", + "integrity": "sha512-23g5BFj4zdQL/b6tor7Ji+QY4pEfNH784BMslY9Qb0UnJWRAt+lQGLYmRaM0KDBwIG23ffEBELhZDP2rhi9f/Q==" + }, "node_modules/mongodb": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.9.0.tgz", diff --git a/package.json b/package.json index 1a47a57..462357b 100644 --- a/package.json +++ b/package.json @@ -7,17 +7,17 @@ "test": "NODE_ENV=test&& npm run build && jest --testTimeout=5000 --detectOpenHandles --forceExit", "test:watch": "npm run build && jest --watch --testTimeout=5000 --detectOpenHandles --forceExit --verbose", "test:verbose": "npm run build && jest --testTimeout=5000 --detectOpenHandles --forceExit --verbose", - "start": "node ./dist/index.js", + "start": "NODE_PATH=src node ./dist/src/index.js", "dev": "ts-node-dev --respawn --pretty --transpile-only --ignore-watch swagger_output.json -r tsconfig-paths/register src/index.ts", - "build": "rimraf ./build && tsc", - "config": "node utils/config.js", - "playground": "nodemon playground/index.js", - "prod": "node dist/index.js", + "build": "rimraf ./dist && tsc", "lint": "npx eslint src/**/*.ts", "lint:fix": "npm run lint -- --fix" }, "author": "", "license": "ISC", + "_moduleAliases": { + "src": "./dist/src" + }, "dependencies": { "axios": "^1.6.7", "bcrypt": "^5.1.1", @@ -27,6 +27,7 @@ "dotenv": "^16.0.3", "express": "^4.18.2", "jsonwebtoken": "^9.0.2", + "module-alias": "^2.2.3", "mongoose": "^7.5.2", "pg": "^8.10.0", "querystring": "^0.2.1", @@ -34,8 +35,6 @@ "url": "^0.11.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.19.1", - "@typescript-eslint/parser": "^6.19.1", "@types/bcrypt": "^5.0.2", "@types/cookie-parser": "^1.4.4", "@types/cors": "^2.8.16", @@ -43,10 +42,18 @@ "@types/jest": "^29.5.5", "@types/jsonwebtoken": "^9.0.5", "@types/mocha": "^10.0.1", + "@types/module-alias": "^2.0.4", "@types/pg": "^8.6.6", "@types/request": "^2.48.10", "@types/supertest": "^2.0.14", "@types/swagger-ui-express": "^4.1.4", + "@typescript-eslint/eslint-plugin": "^6.19.1", + "@typescript-eslint/parser": "^6.19.1", + "chai": "^4.3.7", + "chai-http": "^4.3.0", + "child_process": "^1.0.2", + "dedent-js": "^1.0.1", + "esbuild": "^0.20.0", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-config-standard-with-typescript": "^43.0.1", @@ -55,10 +62,6 @@ "eslint-plugin-prefer-arrow-functions": "^3.2.4", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-promise": "^6.1.1", - "chai": "^4.3.7", - "chai-http": "^4.3.0", - "child_process": "^1.0.2", - "dedent-js": "^1.0.1", "fs": "^0.0.1-security", "jest": "^29.7.0", "mocha": "^10.2.0", diff --git a/src/controllers/index.ts b/src/controllers/index.ts index e69de29..336ce12 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -0,0 +1 @@ +export {} diff --git a/src/controllers/spotifyController.ts b/src/controllers/spotifyController.ts index b825dd2..8434867 100644 --- a/src/controllers/spotifyController.ts +++ b/src/controllers/spotifyController.ts @@ -74,6 +74,7 @@ export const spotifySearch = (_: Request, res: Response) => { /** @swagger #swagger.tags = ['Spotify'] + #swagger.summary = "Not implemented" */ return responses.notImplemented(res) } @@ -82,6 +83,7 @@ export const spotifySearchTracks = (_: Request, res: Response) => { /** @swagger #swagger.tags = ['Spotify'] + #swagger.summary = "Not implemented" */ return responses.notImplemented(res) } @@ -90,6 +92,16 @@ export const spotifySearchTrackId = (_: Request, res: Response) => { /** @swagger #swagger.tags = ['Spotify'] + #swagger.summary = "Not implemented" + */ + return responses.notImplemented(res) +} + +export const getCurrentlyPlaying = (_: Request, res: Response) => { + /** + @swagger + #swagger.tags = ['Spotify'] + #swagger.summary = "Not implemented" */ return responses.notImplemented(res) } diff --git a/src/data/index.ts b/src/data/index.ts index e69de29..336ce12 100644 --- a/src/data/index.ts +++ b/src/data/index.ts @@ -0,0 +1 @@ +export {} diff --git a/src/data/spotifyApi.ts b/src/data/spotifyApi.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/docs/swagger.ts b/src/docs/swagger.ts index 4aa2ec4..e60be76 100644 --- a/src/docs/swagger.ts +++ b/src/docs/swagger.ts @@ -1,7 +1,7 @@ import swaggerAutogen from 'swagger-autogen' const outputFile = './docs/swagger_output.json' -const endpointsFiles = ['src/routes/index.ts', './utils/responses.ts'] +const endpointsFiles = ['src/routes/index.ts'] swaggerAutogen({ openapi: '3.0.0' }) diff --git a/src/index.ts b/src/index.ts index e59bfe4..adf06ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ /** * @fileoverview Entry point of the application. */ +import 'module-alias/register' + import 'dotenv/config' import swaggerUi from 'swagger-ui-express' diff --git a/src/lib/index.ts b/src/lib/index.ts index e69de29..336ce12 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -0,0 +1 @@ +export {} diff --git a/src/middleware/index.ts b/src/middleware/index.ts index e69de29..336ce12 100644 --- a/src/middleware/index.ts +++ b/src/middleware/index.ts @@ -0,0 +1 @@ +export {} diff --git a/src/models/groupModel.ts b/src/models/groupModel.ts new file mode 100644 index 0000000..40c1f4d --- /dev/null +++ b/src/models/groupModel.ts @@ -0,0 +1 @@ +// TODO: Group model diff --git a/tsconfig.json b/tsconfig.json index f3bb0a9..894b2b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -62,9 +62,9 @@ "sourceMap": true /* Create source map files for emitted JavaScript files. */, // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./build" /* Specify an output folder for all emitted files. */, + "outDir": "./dist" /* Specify an output folder for all emitted files. */, // "removeComments": true, /* Disable emitting comments. */ - "noEmit": true, /* Disable emitting files from a compilation. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ @@ -117,10 +117,10 @@ "./src", "./src/**/*.ts", "./src/**/*.json", - "./src/types", "_depricated/services", + "./src/types" // "./src/core/docs/swagger.ts", // "./src/core/docs/api/monitor.doc.ts", ], - "exclude": ["node_modules", "coverage", "logs"], + "exclude": ["node_modules", "coverage", "logs", "_depricated", "dist"], }