Skip to content

Commit

Permalink
Fix TS config
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepold committed Jun 3, 2024
1 parent 593f7b8 commit 9ea9dc7
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 44 deletions.
1 change: 0 additions & 1 deletion dist/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ class App {
}
}
exports.default = App;
//# sourceMappingURL=App.js.map
1 change: 0 additions & 1 deletion dist/App.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
port: 3000
};
//# sourceMappingURL=config.js.map
1 change: 0 additions & 1 deletion dist/config/config.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ const app = new App_1.default(routes_1.default).express;
app.listen(port, () => {
console.log(`API is listening on http://localhost:${port}`);
});
//# sourceMappingURL=index.js.map
1 change: 0 additions & 1 deletion dist/index.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/routes/earthquakes.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ router.get("/earthquakes", (req, res) => __awaiter(this, void 0, void 0, functio
const result = yield earthquake_services_1.queryEarthquakes(req.query);
res.json(result);
}));
//# sourceMappingURL=earthquakes.routes.js.map
1 change: 0 additions & 1 deletion dist/routes/earthquakes.routes.js.map

This file was deleted.

12 changes: 4 additions & 8 deletions dist/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const fs_1 = require("fs");
const path_1 = require("path");
const router = express_1.Router();
const normalizedPath = path_1.default.join(__dirname);
fs_1.default.readdirSync(normalizedPath).forEach((file) => {
const normalizedPath = path_1.join(__dirname);
fs_1.readdirSync(normalizedPath).forEach((file) => {
if (file.includes(".routes.") && !file.includes("index.")) {
router.use("/", require(`./${file}`).router);
}
Expand All @@ -17,4 +14,3 @@ router.get('/', (_req, res) => {
return res.send('Hello World');
});
exports.default = router;
//# sourceMappingURL=index.js.map
1 change: 0 additions & 1 deletion dist/routes/index.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/services/earthquake.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ function queryEarthquakes(query) {
return node_fetch_1.default(url, { headers: { Accept: "application/json" } }).then((response) => response.json());
}
exports.queryEarthquakes = queryEarthquakes;
//# sourceMappingURL=earthquake.services.js.map
1 change: 0 additions & 1 deletion dist/services/earthquake.services.js.map

This file was deleted.

8 changes: 4 additions & 4 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Request, Response, Router } from "express";
import fs from "fs";
import path from "path";
import { readdirSync } from "fs";
import { join } from "path";

const router: Router = Router();
const normalizedPath: string = path.join(__dirname);
const normalizedPath: string = join(__dirname);

fs.readdirSync(normalizedPath).forEach((file) => {
readdirSync(normalizedPath).forEach((file) => {
if (file.includes(".routes.") && !file.includes("index.")) {
router.use("/", require(`./${file}`).router);
}
Expand Down
13 changes: 7 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"esModuleInterop": true,
"outDir": "dist",
"module": "commonjs",
"lib": [
"es2015",
"es2016",
"dom"
],
"baseUrl": ".",
"paths": {
"*": [
Expand Down
34 changes: 19 additions & 15 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"version": 2,
"builds": [
{
"src": "dist/index.js",
"use": "@vercel/node",
"config": { "includeFiles": ["dist/**"] }
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/index.js"
}
]
}
"version": 2,
"builds": [
{
"src": "dist/index.js",
"use": "@vercel/node",
"config": {
"includeFiles": [
"dist/**"
]
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/index.js"
}
]
}

0 comments on commit 9ea9dc7

Please sign in to comment.