diff options
| author | Tom Harley | 2018-04-13 16:21:46 +0100 |
|---|---|---|
| committer | Tom Harley | 2018-04-13 16:21:46 +0100 |
| commit | 1905365083dc63d06de2a169c18163f4b04e231d (patch) | |
| tree | 10ee91cbdb921a2f8c74291eeecca9cae9c9c7ec /src/index.ts | |
| parent | Fix minor places, and add Postman collection (diff) | |
| parent | Merge branch 'trh/gets' of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-... (diff) | |
| download | medicine-1905365083dc63d06de2a169c18163f4b04e231d.tar.gz medicine-1905365083dc63d06de2a169c18163f4b04e231d.zip | |
Merge branch ‘trh/gets’ of gitlab.cs.st-andrews.ac.uk:cs3099group-be-4/project-code into trh/gets
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts index f172e61..7e21c35 100644 --- a/src/index.ts +++ b/src/index.ts @@ -52,18 +52,34 @@ logger.info(`Port ${port} chosen`); isInternal: false, description: 'Systems admin' }); + const logging: UserGroup = new UserGroup({ + name: 'logging', + canAccessLogs: true, + isInternal: false, + description: 'Allows Post to Log' + }); + await logging.save(); await admin.save(); + logger.info('Adding admin user'); const root: User = new User({ username: 'hafeez', - password: 'pass', - userGroups: [admin] + password: 'pass' }); await root.save(); + await root.$set('userGroups', [admin, logging]); + + const user: User | null = await User.findOne({ + include: [{all: true}], + where: { + username: 'hafeez' + } + }); + logger.info('Booting ExpressJS server'); app.listen(port, (err: Error) => { if (err) { |
