sudo apt-get update && sudo apt-get install -y
apt-transport-https ca-certificates curl gnupg
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | sudo apt-key add -
echo "deb https://packages.doppler.com/public/cli/deb/debian any-version main" | sudo tee /etc/apt/sources.list.d/doppler-cli.list
sudo apt-get update && sudo apt-get install doppler
# Prerequisite. gnupg is required for binary signature verification
brew install gnupg
# Next, install using brew (use `doppler update` for subsequent updates)
brew install dopplerhq/cli/doppler
doppler login
- Login: https://dashboard.doppler.com/workplace/auth/cli
- Paste the provideed code
doppler setup
- Select project and environment
doppler secrets
doppler run -- npm run dev
DB
docker-compose up -d
Connection through mongo cli
mongosh --username admin --password admin
Run project
npm i
npm run dev
doppler run -- npm run dev
REQUEST
{
"name": "Landing",
"description": "",
"url": "",
"group": "project1",
"configuration": {
"interval": 300,
"retries": 3,
"retryInterval": 30
}
}
RESPONSE (201)
{
"name": "Landing",
"description": "",
"url": "",
"group": "project1",
"configuration": {
"interval": 300,
"retries": 3,
"retryInterval": 30
}
}
(optional group)
RESPONSE (200)
{
"monitors": [
{ "name": "Landing", "status": "healthy", "group": ["project1"] }
]
}
RESPONSE (200)
{
"name": "Landing",
"description": "",
"url": "",
"group": "project1",
"configuration": {
"interval": 300,
"retries": 3,
"retryInterval": 30
},
"uptimeDay": 99.9,
"uptimeMonth": 98.3
}
npm init
npm install express
const express = require("express");
const app = express();
const port = 3000;
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});
npm install nodemon --save-dev
Modify script in package.json
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon index.js",
"start": "node index.js"
},
Run app:
npm run dev
npm install cors
app.use(express.json());
app.use(express.urlencoded({
extended: true
}));
npm i -D typescript @types/express @types/node
Create tsconfig.json
npx tsc --init
Update package.json script
"build": "npx tsc",
"dev": "nodemon src/index.ts",
"start": "tsc && node dist/index.js"
Install mongoose
npm install mongoose
Create config/database.ts
npm i dotenv
npm install --save node-cron
npm i --save-dev @types/node-cron
npm i ping