diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d0f84c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package.json ./ +COPY app.js ./ + +EXPOSE 8080 + +CMD ["node", "app.js"] diff --git a/app.js b/app.js new file mode 100644 index 0000000..6c0e13e --- /dev/null +++ b/app.js @@ -0,0 +1,17 @@ +const http = require('http'); + +const PORT = 8080; + +const server = http.createServer((req, res) => { + if (req.method === 'GET' && req.url === '/') { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('7thhh updateee Hello World'); + } else { + res.writeHead(404, { 'Content-Type': 'text/plain' }); + res.end('Not Found'); + } +}); + +server.listen(PORT, () => { + console.log(`Server running on port ${PORT}`); +}); diff --git a/boltic-properties.yaml b/boltic-properties.yaml new file mode 100644 index 0000000..bcecc6f --- /dev/null +++ b/boltic-properties.yaml @@ -0,0 +1,36 @@ +app: "anujbugtest" +serverlessId: "ce200692-ad45-4edd-b63b-f052f7ce51bb" +region: "asia-south1" +handler: "handler.handler" +language: "nodejs/20" + +serverlessConfig: + Name: "anujbugtest" + Description: "" + Runtime: "git" + # Environment variables for your serverless function + # To add env variables, replace {} with key-value pairs like: + # Env: + # API_KEY: "your-api-key" + #TO add port map, replace {} with port map like: + # PortMap: + # - Name: "port" + # Port: "8080" + # Protocol: "http"/"https" + Env: {} + PortMap: {} + Scaling: + AutoStop: false + Min: 1 + Max: 1 + MaxIdleTime: 300 + Resources: + CPU: 0.1 + MemoryMB: 128 + MemoryMaxMB: 128 + Timeout: 60 + Validations: null + +build: + builtin: dockerfile + ignorefile: .gitignore diff --git a/boltic.yaml b/boltic.yaml deleted file mode 100644 index 9163844..0000000 --- a/boltic.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# ============================================================================ -# Boltic Configuration File - helloworldpage -# ============================================================================ -# -# ⚠️ WARNING: Changes to this file will directly impact your deployed application! -# - Env changes will update environment variables -# - Scaling changes will affect auto-scaling behavior -# - PortMap changes will modify exposed ports -# -# This file is synced with the Boltic UI. You can edit settings here or in the UI. -# -# ---------------------------------------------------------------------------- -# SERVERLESS CONFIG GUIDE -# ---------------------------------------------------------------------------- -# -# Environment Variables (Env): -# serverlessConfig: -# Env: -# MY_VAR: "my_value" -# DATABASE_URL: "postgres://..." -# API_KEY: "secret-key" -# -# Port Mapping (PortMap): -# serverlessConfig: -# PortMap: -# - Name: "testhttp" -# Port: 8080 -# Protocol: "http" -# - Name: "test https" -# Port: 9090 -# Protocol: "https" -# -# Scaling Configuration: -# serverlessConfig: -# Scaling: -# AutoStop: true # Auto-stop when idle -# Min: 1 # Minimum instances -# Max: 5 # Maximum instances -# MaxIdleTime: 300 # Seconds before auto-stop -# -# Resources: -# serverlessConfig: -# Resources: -# CPU: 0.5 # CPU cores (0.1 to 4) -# MemoryMB: 256 # Memory in MB -# MemoryMaxMB: 512 # Max memory in MB -# -# Timeout: -# serverlessConfig: -# Timeout: 120 # Request timeout in seconds -# -# For more info: https://docs.boltic.io/docs/compute/serverless/application-config -# ============================================================================ - -app: helloworldpage -language: nodejs/18 -region: asia-south1 -serverlessConfig: - Scaling: - AutoStop: false - Min: 1 - Max: 1 - MaxIdleTime: 300 - Resources: - CPU: 0.1 - MemoryMB: 128 - MemoryMaxMB: 128 diff --git a/handler.js b/handler.js deleted file mode 100644 index 8c49335..0000000 --- a/handler.js +++ /dev/null @@ -1,26 +0,0 @@ -function toNumber(value) { - const n = Number(value); - return Number.isFinite(n) ? n : 0; -} - -function updateSum() { - const aEl = document.getElementById("numA"); - const bEl = document.getElementById("numB"); - const resultEl = document.getElementById("result"); - - if (!aEl || !bEl || !resultEl) return; - - const sum = toNumber(aEl.value) + toNumber(bEl.value); - resultEl.value = String(sum); -} - -document.addEventListener("input", (e) => { - const target = e.target; - if (!(target instanceof HTMLElement)) return; - if (target.id !== "numA" && target.id !== "numB") return; - updateSum(); -}); - -document.addEventListener("DOMContentLoaded", () => { - updateSum(); -}); diff --git a/index.html b/index.html deleted file mode 100644 index b041487..0000000 --- a/index.html +++ /dev/null @@ -1,97 +0,0 @@ - - -
- - -