Skip to content

Commit 9df0ec3

Browse files
committed
Merge branch 'release/v0.1.0'
2 parents d99e792 + 35d7626 commit 9df0ec3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1383
-409
lines changed

index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* NOTE: This file is only used for development as a way to import the environment variables from the ".env" file.
3+
*/
4+
5+
import dotenv = require('dotenv');
6+
dotenv.config();
7+
8+
import './src/server';

nodemon.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"watch": ["src"],
3+
"ext": "ts",
4+
"ignore": ["src/**/*.spec.ts"],
5+
"exec": "npm run debug"
6+
}

package-lock.json

Lines changed: 44 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@
77
"type": "git",
88
"url": "https://github.com/nerdybeast/sith-api"
99
},
10+
"main": "./dist/server.js",
1011
"scripts": {
11-
"start": "npm run build && node dist/server.js",
12-
"build": "tsc"
12+
"start": "node dist/server.js",
13+
"dev": "nodemon",
14+
"debug": "ts-node --inspect=5858 index.ts",
15+
"build": "tsc",
16+
"prod": "tsc && node dist/server.js",
17+
"postinstall": "npm run build"
1318
},
1419
"dependencies": {
1520
"@nestjs/common": "^4.4.0",
1621
"@nestjs/core": "^4.4.0",
1722
"@nestjs/microservices": "^4.4.0",
1823
"@nestjs/testing": "^4.4.0",
1924
"@nestjs/websockets": "^4.4.0",
25+
"@types/node": "^8.5.8",
26+
"@types/socket.io": "^1.4.31",
2027
"body-parser": "^1.18.2",
2128
"camelcase-keys": "^4.2.0",
2229
"cors": "2.8.4",
@@ -26,7 +33,9 @@
2633
"jsonapi-serializer": "^3.5.5",
2734
"jsonwebtoken": "8.1.0",
2835
"lodash.camelcase": "^4.3.0",
36+
"lodash.isequal": "^4.5.0",
2937
"lodash.mapkeys": "^4.6.0",
38+
"moment": "^2.20.1",
3039
"morgan": "^1.9.0",
3140
"redis": "2.8.0",
3241
"reflect-metadata": "^0.1.10",
@@ -43,9 +52,9 @@
4352
"@types/jsforce": "^1.8.7",
4453
"@types/jsonwebtoken": "^7.2.5",
4554
"@types/morgan": "^1.7.35",
46-
"@types/node": "^8.0.28",
4755
"@types/redis": "^2.8.3",
56+
"dotenv": "^5.0.0",
4857
"nodemon": "^1.12.1",
49-
"ts-node": "^4.0.2"
58+
"ts-node": "^4.1.0"
5059
}
5160
}

src/components/factories/cache-factory.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
import { Component } from '@nestjs/common';
22
import { ICache } from '../../interfaces/ICache';
33
import { MemoryCache } from '../services/memory-cache-service';
4+
import { Debug } from '../../utilities/debug';
45

56
@Component()
67
export class CacheFactory {
78

89
private static cacheInstance: ICache;
910

1011
public static getCache() : ICache {
12+
13+
const debug = new Debug('CacheFactory');
14+
1115
//TODO: decide to return redis cache or not...
12-
if(!this.cacheInstance) this.cacheInstance = new MemoryCache();
16+
if(!this.cacheInstance) {
17+
this.cacheInstance = new MemoryCache();
18+
debug.info(`new cache instance created`);
19+
} else {
20+
debug.info(`same cache instance used`);
21+
}
22+
1323
return this.cacheInstance;
1424
}
1525

0 commit comments

Comments
 (0)