Skip to content

Commit

Permalink
remove swagger - only got it to work locally using raw-loader in swag…
Browse files Browse the repository at this point in the history
…ger-ui-express. Could not get it to work on dev or prod. See scottie1984/swagger-ui-express#90
  • Loading branch information
azizj1 committed Sep 11, 2018
1 parent a96eb00 commit 32bce7c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 43 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Google Calendar Analytics
Express.js RESTful API that uses [Google Calendar API](https://developers.google.com/calendar/) to inquire my private calendars. The endpoints of the API can be found on [the Swagger page](https://0jhkh4pn4b.execute-api.us-east-1.amazonaws.com/prod/docs).
Express.js RESTful API that uses [Google Calendar API](https://developers.google.com/calendar/) to inquire my private calendars. The following endpoints are provided:
* /v1/calendars/fitness/bjj

## Getting Started
Being a node app, the app has a few prerequisites.
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@types/debug": "^0.0.30",
"@types/moment": "^2.13.0",
"@types/morgan": "^1.7.35",
"@types/swagger-ui-express": "^3.0.0",
"babel-loader": "^8.0.2",
"clean-webpack-plugin": "^0.1.19",
"nodemon": "^1.18.4",
Expand All @@ -57,7 +56,6 @@
"express": "^4.16.3",
"moment": "^2.22.2",
"morgan": "^1.9.0",
"node-google-calendar": "^1.1.1",
"swagger-ui-express": "^4.0.1"
"node-google-calendar": "^1.1.1"
}
}
3 changes: 0 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as logger from 'morgan';
import * as cors from 'cors';
import * as swaggerUi from 'swagger-ui-express';
import * as swaggerDoc from '~/../swagger.json';
import chalk from 'chalk';
import routes from './routes';

Expand All @@ -29,7 +27,6 @@ app.use(cors());
app.use(logger(':datetime :method :url :status :response-time ms - :res[content-length] bytes'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc));
app.use('/', routes);

// catch 404 and forward to error handler
Expand Down
10 changes: 5 additions & 5 deletions terraform/environments/dev/terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 3,
"terraform_version": "0.11.8",
"serial": 15,
"serial": 28,
"lineage": "16488214-507e-9695-1faf-48be0837be9c",
"modules": [
{
Expand Down Expand Up @@ -275,21 +275,21 @@
"dead_letter_config.#": "0",
"description": "Nodejs API to provide aggregate data on private calendars",
"environment.#": "0",
"filename": "/Users/azizjaved/Projects/google-calendar/google-calendar-analytics/terraform/environments/dev/.terraform/modules/8fa7b52ac065798b03b18ef41a2628c4/lambda.zip",
"filename": "C:\\Projects\\google-calendar-analytics\\terraform\\environments\\dev\\.terraform\\modules\\8fa7b52ac065798b03b18ef41a2628c4/lambda.zip",
"function_name": "dev-calendar-api",
"handler": "lambda.handler",
"id": "dev-calendar-api",
"invoke_arn": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:931615791205:function:dev-calendar-api/invocations",
"kms_key_arn": "",
"last_modified": "2018-09-11T06:02:45.795+0000",
"last_modified": "2018-09-11T21:53:33.858+0000",
"memory_size": "256",
"publish": "false",
"qualified_arn": "arn:aws:lambda:us-east-1:931615791205:function:dev-calendar-api:$LATEST",
"reserved_concurrent_executions": "0",
"role": "arn:aws:iam::931615791205:role/dev-iam_for_calendar_api_lambda",
"runtime": "nodejs8.10",
"source_code_hash": "4ICLAmoEGrA7DFkfFWkkemE7RzghryNw55A4wUW3H/k=",
"source_code_size": "827681",
"source_code_hash": "wm8FnI0VRGesb3qhZg46pPqtTW6/6fw/YbLe97koEz0=",
"source_code_size": "827682",
"tags.%": "0",
"timeout": "30",
"tracing_config.#": "1",
Expand Down
8 changes: 4 additions & 4 deletions terraform/environments/dev/terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 3,
"terraform_version": "0.11.8",
"serial": 15,
"serial": 28,
"lineage": "16488214-507e-9695-1faf-48be0837be9c",
"modules": [
{
Expand Down Expand Up @@ -281,15 +281,15 @@
"id": "dev-calendar-api",
"invoke_arn": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:931615791205:function:dev-calendar-api/invocations",
"kms_key_arn": "",
"last_modified": "2018-09-10T19:32:29.099+0000",
"last_modified": "2018-09-11T21:16:05.401+0000",
"memory_size": "256",
"publish": "false",
"qualified_arn": "arn:aws:lambda:us-east-1:931615791205:function:dev-calendar-api:$LATEST",
"reserved_concurrent_executions": "0",
"role": "arn:aws:iam::931615791205:role/dev-iam_for_calendar_api_lambda",
"runtime": "nodejs8.10",
"source_code_hash": "hqw10NxgtJF7l2gAHN1Oyq9nFepVfM/T/NxwgfRRcXo=",
"source_code_size": "827636",
"source_code_hash": "HnivdrojWXsIdigs9DRUQX9nQgOnXLjcQAenG/XEtgc=",
"source_code_size": "1196369",
"tags.%": "0",
"timeout": "30",
"tracing_config.#": "1",
Expand Down
10 changes: 5 additions & 5 deletions terraform/environments/prod/terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 3,
"terraform_version": "0.11.8",
"serial": 3,
"serial": 7,
"lineage": "0f55e5c7-5c71-fccf-a842-bdfe94b5bd30",
"modules": [
{
Expand Down Expand Up @@ -275,21 +275,21 @@
"dead_letter_config.#": "0",
"description": "Nodejs API to provide aggregate data on private calendars",
"environment.#": "0",
"filename": "/Users/azizjaved/Projects/google-calendar/google-calendar-analytics/terraform/environments/prod/.terraform/modules/8fa7b52ac065798b03b18ef41a2628c4/lambda.zip",
"filename": "C:\\Projects\\google-calendar-analytics\\terraform\\environments\\prod\\.terraform\\modules\\8fa7b52ac065798b03b18ef41a2628c4/lambda.zip",
"function_name": "calendar-api",
"handler": "lambda.handler",
"id": "calendar-api",
"invoke_arn": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:931615791205:function:calendar-api/invocations",
"kms_key_arn": "",
"last_modified": "2018-09-11T06:05:05.277+0000",
"last_modified": "2018-09-11T19:27:24.023+0000",
"memory_size": "256",
"publish": "false",
"qualified_arn": "arn:aws:lambda:us-east-1:931615791205:function:calendar-api:$LATEST",
"reserved_concurrent_executions": "0",
"role": "arn:aws:iam::931615791205:role/iam_for_calendar_api_lambda",
"runtime": "nodejs8.10",
"source_code_hash": "4ICLAmoEGrA7DFkfFWkkemE7RzghryNw55A4wUW3H/k=",
"source_code_size": "827681",
"source_code_hash": "qqBRSsTx/vrHeJE2BPuiRHwqDUcxQMt9nC+oqdDwals=",
"source_code_size": "827682",
"tags.%": "0",
"timeout": "30",
"tracing_config.#": "1",
Expand Down
10 changes: 5 additions & 5 deletions terraform/environments/prod/terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 3,
"terraform_version": "0.11.8",
"serial": 3,
"serial": 7,
"lineage": "0f55e5c7-5c71-fccf-a842-bdfe94b5bd30",
"modules": [
{
Expand Down Expand Up @@ -275,21 +275,21 @@
"dead_letter_config.#": "0",
"description": "Nodejs API to provide aggregate data on private calendars",
"environment.#": "0",
"filename": "/Users/azizjaved/Projects/google-calendar/google-calendar-analytics/terraform/environments/prod/.terraform/modules/8fa7b52ac065798b03b18ef41a2628c4/lambda.zip",
"filename": "C:\\Projects\\google-calendar-analytics\\terraform\\environments\\prod\\.terraform\\modules\\8fa7b52ac065798b03b18ef41a2628c4/lambda.zip",
"function_name": "calendar-api",
"handler": "lambda.handler",
"id": "calendar-api",
"invoke_arn": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:931615791205:function:calendar-api/invocations",
"kms_key_arn": "",
"last_modified": "2018-09-06T12:48:27.525+0000",
"last_modified": "2018-09-11T19:25:55.940+0000",
"memory_size": "256",
"publish": "false",
"qualified_arn": "arn:aws:lambda:us-east-1:931615791205:function:calendar-api:$LATEST",
"reserved_concurrent_executions": "0",
"role": "arn:aws:iam::931615791205:role/iam_for_calendar_api_lambda",
"runtime": "nodejs8.10",
"source_code_hash": "TweAE0qjrMnbWA0H9DJplWq2LEGhqiEbKzLcINfI+Ek=",
"source_code_size": "827581",
"source_code_hash": "BgCGtBd30pNqqS2fWXaMAomcz/EQu8hxCge/lf6NR28=",
"source_code_size": "827682",
"tags.%": "0",
"timeout": "30",
"tracing_config.#": "1",
Expand Down
17 changes: 0 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -641,13 +641,6 @@
"@types/express-serve-static-core" "*"
"@types/mime" "*"

"@types/swagger-ui-express@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/swagger-ui-express/-/swagger-ui-express-3.0.0.tgz#7c3217cb6d900be1601053d791cfd16725cddd22"
dependencies:
"@types/express" "*"
"@types/serve-static" "*"

"@webassemblyjs/[email protected]":
version "1.5.13"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.5.13.tgz#81155a570bd5803a30ec31436bc2c9c0ede38f25"
Expand Down Expand Up @@ -3962,16 +3955,6 @@ supports-color@^5.2.0, supports-color@^5.3.0, supports-color@^5.4.0:
dependencies:
has-flag "^3.0.0"

swagger-ui-dist@^3.18.1:
version "3.18.2"
resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-3.18.2.tgz#025f8838a135f9476a839dd37696ba3ebd86ea06"

swagger-ui-express@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/swagger-ui-express/-/swagger-ui-express-4.0.1.tgz#4c8a5a7799d6deb02bedbe032386ceb12fb23c91"
dependencies:
swagger-ui-dist "^3.18.1"

tapable@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2"
Expand Down

0 comments on commit 32bce7c

Please sign in to comment.