Skip to content

Commit a723471

Browse files
authored
Feature: entities and models (#2)
* add entites * ref: rename servers to managers * fix entites * add managers and other stuffs * add index & types
1 parent 0be32f0 commit a723471

17 files changed

+1169
-57
lines changed

config.default.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
module.exports = {
2-
mongo: {
3-
// see <http://sierrasoftworks.github.io/Iridium/interfaces/configuration.html>
4-
database: 'leo-fight',
5-
host: 'localhost',
6-
port: 27017
7-
},
8-
uc: {
9-
url: 'http://127.0.0.1:3000'
10-
},
112
httpServer: {
123
host: '127.0.0.1',
134
port: 3010,
145
allowOrigins: [
156
/^https?:\/\/localhost:\d+$/
167
]
178
},
18-
realtimeServer: {
19-
host: '127.0.0.1',
20-
port: 3011,
21-
publicUrl: 'http://localhost:3011/realtime'
22-
},
239
secret: {
24-
session: 'You!MUST!ChangeThis',
25-
room: 'MUST!ChangeThisOne,too'
10+
session: 'You!MUST!ChangeThis'
2611
},
27-
arena: {
28-
server: 'ws://localhost:4000'
12+
dbConnection: {
13+
type: 'sqlite',
14+
database: 'data/demo.db'
2915
}
3016
}

data/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

ormconfig.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Provide TypeORM Config
3+
* @file
4+
*/
5+
6+
require('reflect-metadata')
7+
require('ts-node/register')
8+
9+
const Container = require('typedi').Container
10+
const ConfigService = require('./src/services/ConfigService').ConfigService
11+
12+
const configService = Container.get(ConfigService)
13+
14+
module.exports = configService.config.dbConnection

0 commit comments

Comments
 (0)