Initial commit
This commit is contained in:
commit
45d6a38e49
|
|
@ -0,0 +1,4 @@
|
|||
node_modules
|
||||
npm-debug.log
|
||||
.git
|
||||
.gitignore
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
node_modules
|
||||
.env
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install --production
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
app: "git-serverless"
|
||||
region: "asia-south1"
|
||||
handler: "handler.handler"
|
||||
language: "nodejs/20"
|
||||
|
||||
serverlessConfig:
|
||||
serverlessId: "e2145e2c-ec54-484e-b036-e7ca4728bcbc"
|
||||
Name: "git-serverless"
|
||||
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,17 @@
|
|||
const express = require('express');
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 8080;
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.get('/hello', (req, res) => {
|
||||
res.json({ message: 'Hello from git-serverless!' });
|
||||
});
|
||||
|
||||
app.get('/health', (req, res) => {
|
||||
res.json({ status: 'ok' });
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Server running on port ${PORT}`);
|
||||
});
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "git-serverless",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.18.2"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user