+ CustomSite.prototype = Object.create(_jst_server.Site.prototype)
+
+ // called when the server starts or the site.jst file is modified
+ // in latter case it will carry over the previously created resource objects
+ CustomSite.prototype.start = async function() {
+ await _jst_server.Site.prototype.start.call(this)
+
+ assert(this.database === undefined)
+ this.database = await this.resources.ref(
+ 'database',
+ async () => {
+ let database = new logjson.Database()
+ await database.open(this.root + '/database.logjson')
+ return database
+ }
+ )
+
+ assert(this.emailjs_cache === undefined)
+ this.emailjs_cache = await this.resources.ref(
+ 'emailjs_cache',
+ async () => new EmailJSCache(true)
+ )
+
+ assert(this.zettair_cache === undefined)
+ this.zettair_cache = await this.resources.ref(
+ 'zettair_cache',
+ async () => new ZettairCache(true)
+ )
+ }