mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-24 15:26:46 -05:00
Simplify Juxt community creation script
This commit is contained in:
parent
5061234d83
commit
4ba607a278
|
|
@ -1,5 +1,7 @@
|
|||
// This should be evaled in the juxtaposition-ui container
|
||||
require("module-alias/register");
|
||||
const mongoose = require("mongoose");
|
||||
const { connect } = require("./src/database");
|
||||
const { COMMUNITY } = require("./src/models/communities");
|
||||
const fs = require("fs").promises;
|
||||
const sharp = require("sharp");
|
||||
|
|
@ -37,21 +39,6 @@ runAsync().then(() => {
|
|||
process.exit(0);
|
||||
});
|
||||
|
||||
async function connect() {
|
||||
await mongoose.connect(process.env.JUXT_CONFIG_MONGODB_URI, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
});
|
||||
const connection = mongoose.connection;
|
||||
connection.on("connected", function () {
|
||||
logger.info(`MongoDB connected ${this.name}`);
|
||||
});
|
||||
connection.on("error", console.error.bind(console, "connection error:"));
|
||||
connection.on("close", () => {
|
||||
connection.removeAllListeners();
|
||||
});
|
||||
}
|
||||
|
||||
async function createMainCommunity(
|
||||
platform_id,
|
||||
name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user