Skip to content

Commit 55aadbb

Browse files
author
Umed Khudoiberdiev
committed
small corrections
1 parent 5b58fb4 commit 55aadbb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {createConnection} from "typeorm";
33
import {Request, Response} from "express";
44
import * as express from "express";
55
import * as bodyParser from "body-parser";
6-
import {ROUTES} from "./routes";
6+
import {AppRoutes} from "./routes";
77

88
// create connection with database
99
// note that its not active database connection
@@ -14,8 +14,8 @@ createConnection().then(async connection => {
1414
const app = express();
1515
app.use(bodyParser.json());
1616

17-
// register all routes
18-
ROUTES.forEach(route => {
17+
// register all application routes
18+
AppRoutes.forEach(route => {
1919
app[route.method](route.path, (request: Request, response: Response, next: Function) => {
2020
route.action(request, response)
2121
.then(() => next)
@@ -26,4 +26,4 @@ createConnection().then(async connection => {
2626
// run app
2727
app.listen(3000);
2828

29-
}).catch(error => console.log("Error: ", error));
29+
}).catch(error => console.log("TypeORM connection error: ", error));

src/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {postSaveAction} from "./controller/PostSaveAction";
55
/**
66
* All application routes.
77
*/
8-
export const ROUTES = [
8+
export const AppRoutes = [
99
{
1010
path: "/posts",
1111
method: "get",

0 commit comments

Comments
 (0)