Skip to content

Commit fc34bc8

Browse files
committed
Updated small definition issues
1 parent 0b0c5c1 commit fc34bc8

File tree

4 files changed

+125
-71
lines changed

4 files changed

+125
-71
lines changed

server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function runServer() {
2828
// Load and prefix all routes with /api and appropriate version
2929
app.use("/v2", v2);
3030

31-
app.route("/v1*").get(function (req, res, next) {
31+
app.route("/v1*splat").get(function (req, res, next) {
3232
res.status(410).send({
3333
error:
3434
"Macrostrat's v1 API has been retired. Please update your usage to newer endpoints.",

v2/definitions/structures.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
var api = require("../api");
2-
var larkin = require("../larkin");
1+
const api = require("../api");
2+
const larkin = require("../larkin");
33

44
module.exports = function (req, res, next, cb) {
55
if (Object.keys(req.query).length < 1) {
66
return larkin.info(req, res, next);
77
}
88

9-
var where = [];
9+
let where = [];
1010
//changed back to dict
11-
var params = {};
12-
var limit = req.query.hasOwnProperty("sample") ? "LIMIT 5" : "";
11+
let params = {};
12+
let limit = req.query.hasOwnProperty("sample") ? "LIMIT 5" : "";
1313

1414
//updated sql variables to named parameters using yesql
1515
if (req.query.structure_class) {
@@ -35,7 +35,7 @@ module.exports = function (req, res, next, cb) {
3535

3636
where = where.length ? "WHERE " + where.join(" AND ") : "";
3737

38-
var sql = `
38+
const sql = `
3939
SELECT
4040
structures.id AS structure_id,
4141
structure AS name,

v2/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export async function buildAPI() {
8888

8989
api.route("/hex-summary/max/:zoom").get(require("./hex_summary_max"));
9090

91-
api.route("*").get(require("./catchall"));
91+
api.route("*splat").get(require("./catchall"));
9292

9393
api.use(function (err, req, res, next) {
9494
if (err.status !== 404) {

0 commit comments

Comments
 (0)