Skip to content

Commit cbbb42a

Browse files
committed
fix: swagger doc to use https only & include routes description
1 parent dac887b commit cbbb42a

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

middlewares/security.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import hpp from "hpp";
22
import cors from "cors";
33
import helmet from "helmet";
44
import morgan from "morgan";
5-
// import xss from "xss-clean";
65
import express from "express";
76
import { configDotenv } from "dotenv";
87

@@ -25,8 +24,6 @@ export const securityMiddleware = app => {
2524
methods: ["GET", "POST", "DELETE"],
2625
})
2726
);
28-
// sanitize user input
29-
// app.use(xss());
3027
// prevent http paramter pollution
3128
app.use(hpp());
3229
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "app.js",
66
"type": "module",
77
"scripts": {
8-
"start": "node swagger.js && node app.js",
9-
"dev": "node swagger.js && nodemon app.js"
8+
"start": "node app.js",
9+
"dev": "nodemon app.js"
1010
},
1111
"keywords": [],
1212
"author": "",

swagger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const docs = {
1111
"A RESTful API service that analyzes strings and stores their computed properties",
1212
},
1313
basePath: "/",
14-
schemes: ["http", "https"],
15-
host: process.env.HOST || "localhost:3000",
14+
schemes: ["https"],
15+
host: process.env.HOST,
1616
tags: [
1717
{ name: "Home" },
1818
{ name: "Strings", description: "String Analyzer Endpoints" },

swagger.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "String Analyzer API",
66
"description": "A RESTful API service that analyzes strings and stores their computed properties"
77
},
8-
"host": "localhost:3000",
8+
"host": "node-string-analysis-api-production.up.railway.app/",
99
"basePath": "/",
1010
"tags": [
1111
{
@@ -16,7 +16,7 @@
1616
"description": "String Analyzer Endpoints"
1717
}
1818
],
19-
"schemes": ["http", "https"],
19+
"schemes": ["https"],
2020
"paths": {
2121
"/": {
2222
"get": {
@@ -128,7 +128,7 @@
128128
},
129129
"delete": {
130130
"tags": ["Strings"],
131-
"description": "",
131+
"description": "Delete Specific String (by its value)",
132132
"parameters": [
133133
{
134134
"name": "value",

0 commit comments

Comments
 (0)