-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal.js
More file actions
39 lines (30 loc) · 863 Bytes
/
local.js
File metadata and controls
39 lines (30 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
const mongoose = require('mongoose');
const connect = require('./seed/connect');
const express = require('express');
const studio = require('./express');
const getModelDescriptions = require('./backend/helpers/getModelDescriptions');
Error.stackTraceLimit = 25;
run().catch(err => {
console.error(err);
process.exit(-1);
});
async function run() {
const app = express();
await connect();
console.log(getModelDescriptions(mongoose.connection));
app.use('/studio', await studio(
null,
null,
{
__build: true,
__watch: process.env.WATCH,
_mothershipUrl: 'http://localhost:7777/.netlify/functions',
apiKey: 'TACO',
openAIAPIKey: process.env.OPENAI_API_KEY,
googleGeminiAPIKey: process.env.GEMINI_API_KEY
})
);
await app.listen(3333);
console.log('Listening on port 3333');
}