diff options
| author | Tom Harley | 2018-03-02 18:03:31 +0000 |
|---|---|---|
| committer | Tom Harley | 2018-03-02 18:03:31 +0000 |
| commit | 84b8b5323654cf43ef549d2151bd3206c666d9d8 (patch) | |
| tree | 1ddcff5f713d7cca2c14f94ee97808cc7f4a354b /src/index.ts | |
| parent | added middleware to check if admin (diff) | |
| download | medicine-84b8b5323654cf43ef549d2151bd3206c666d9d8.tar.gz medicine-84b8b5323654cf43ef549d2151bd3206c666d9d8.zip | |
Plug in authentication support - WIP
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts index 06989ef..c6adf32 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ import { default as app } from './app'; import { default as seq } from './db/orm'; console.log('end import'); +import { default as User } from './db/model/User'; import { default as UserGroup } from './db/model/UserGroup'; const DEFAULT_PORT: number = 3000; @@ -39,8 +40,17 @@ const port: number = process.env.PORT description: 'Systems admin' }); - // tslint:disable:no-floating-promises - admin.save(); + await admin.save(); + + console.log(admin.id); + + const root: User = new User({ + username: 'hafeez', + password: 'pass', + userGroup: admin + }); + + root.save(); console.log('Booting ExpressJS server'); |
