1st
This commit is contained in:
commit
4c5eb8f434
|
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json ./
|
||||||
|
COPY app.js ./
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
CMD ["node", "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('1st 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}`);
|
||||||
|
});
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "hello-world-app",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Simple Node.js Hello World app",
|
||||||
|
"main": "app.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node app.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user