Initial commit

Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com>
This commit is contained in:
Eric Tuvesson
2023-12-04 10:20:38 +01:00
commit 663c0a2e39
43 changed files with 39568 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# Noodl Cloud Services Docker
This package contains the docker image of the Noodl Self Hosted Cloud Service.
## Health Endpoints
```
# The application is up and running.
/health/live
# The application is ready to serve requests.
/health/ready
# Accumulating all health check procedures in the application.
/health
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
{
"name": "@noodl/cloudservice-docker",
"version": "1.0.0",
"description": "Low-code for when experience matter",
"author": "Noodl <info@noodl.net>",
"homepage": "https://noodl.net",
"license": "MIT",
"scripts": {
"start": "node ./src/index.js",
"test": "./node_modules/.bin/jasmine"
},
"dependencies": {
"@noodl/cloudservice": "file:../noodl-cloudservice",
"cors": "^2.8.5",
"express": "^4.17.1"
},
"devDependencies": {
"jasmine": "^4.0.2"
}
}

View File

@@ -0,0 +1,11 @@
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@@ -0,0 +1,57 @@
const { createNoodlServer } = require("@noodl/cloudservice");
const express = require("express");
const cors = require("cors");
// Get environment variable that is a number, if not return undefined
function _getNumberEnv(_value) {
const val = Number(_value);
if (isNaN(val)) return undefined;
else return val;
}
const port = Number(process.env.PORT || 3000);
const databaseURI = String(process.env.DATABASE_URI);
const masterKey = String(process.env.MASTER_KEY);
const appId = String(process.env.APP_ID);
const server = express();
server.use(
cors({
// Set the browser cache time for preflight responses
maxAge: 86400,
})
);
server.use(
express.urlencoded({
extended: true,
})
);
server.use(
express.json({
limit: "2mb",
})
);
const noodlServer = createNoodlServer({
port,
databaseURI,
masterKey,
appId,
functionOptions: {
timeOut: _getNumberEnv(process.env.CLOUD_FUNCTIONS_TIMEOUT),
memoryLimit: _getNumberEnv(process.env.CLOUD_FUNCTIONS_MEMORY_LIMIT),
},
parseOptions: {
maxUploadSize: process.env.MAX_UPLOAD_SIZE || "20mb",
// set or override any of the Parse settings
},
});
server.use("/", noodlServer.middleware);
server.listen(port, () => {
console.log(`Noodl Parse Server listening at http://localhost:${port}`);
});