aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorjw2552018-04-16 19:34:57 +0100
committerjw2552018-04-16 19:34:57 +0100
commit4ec93e886fc10de2c65e9599dbfca2a70db578e3 (patch)
tree19fc41cf02e37b3094c98af10affd94d2bb08784 /src/index.ts
parentMerge branch 'trh/gets' of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-... (diff)
downloadmedicine-4ec93e886fc10de2c65e9599dbfca2a70db578e3.tar.gz
medicine-4ec93e886fc10de2c65e9599dbfca2a70db578e3.zip

World War Files, part 1folder is automatically created at the start of the server. also project folder should now appear in the filesystem

Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts
index 7e21c35..5960374 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -8,7 +8,9 @@ import { default as app } from './app';
logger.info('Importing database ORM');
import { default as seq } from './db/orm';
+import { View, files, views, rootPathId, createRootFolder } from './files';
+import { default as File } from './db/model/File';
import { default as User } from './db/model/User';
import { default as UserGroup } from './db/model/UserGroup';
@@ -40,6 +42,14 @@ logger.info(`Port ${port} chosen`);
process.exit(1);
}
+ logger.info('Setting up directory structure');
+ const rootDir: File = new File({
+ uuid: rootPathId,
+ mimetype: 'inode/directory',
+ name: '/'
+ });
+ await rootDir.save();
+
logger.info('Adding admin privileges');
const admin: UserGroup = new UserGroup({
name: 'admin',
@@ -70,6 +80,7 @@ logger.info(`Port ${port} chosen`);
});
await root.save();
+ createRootFolder();
await root.$set('userGroups', [admin, logging]);