Skip to content

Commit f025e7d

Browse files
committed
initials
0 parents  commit f025e7d

5 files changed

Lines changed: 100 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Zappify CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Run app (test)
24+
run: node index.js
25+
26+
- name: Build Docker image
27+
run: docker build -t zappify-app .

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
package-lock.json
3+
zappify@1.0.0
4+
.env

‎Dockerfile‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:18
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm install
7+
8+
COPY . .
9+
10+
EXPOSE 3000
11+
12+
CMD ["npm", "run", "dev"]

‎index.js‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const express = require("express");
2+
3+
const app = express();
4+
const PORT = 3000;
5+
6+
7+
app.use(express.json());
8+
9+
10+
app.get("/", (req, res) => {
11+
res.send("Zappify Backend Running 🚀");
12+
});
13+
14+
15+
app.get("/api", (req, res) => {
16+
res.json({ message: "Hello Devendra " });
17+
});
18+
19+
20+
app.post("/data", (req, res) => {
21+
const data = req.body;
22+
res.json({
23+
message: "Data received ",
24+
data: data,
25+
});
26+
});
27+
28+
29+
app.listen(PORT, () => {
30+
console.log(`Server running on http://localhost:${PORT}`);
31+
});

‎package.json‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "zappify",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"dev": "node index.js",
8+
"start": "node index.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/Mishra-coder/Zappify.git"
14+
},
15+
"keywords": [],
16+
"author": "",
17+
"license": "ISC",
18+
"type": "commonjs",
19+
"bugs": {
20+
"url": "https://github.com/Mishra-coder/Zappify/issues"
21+
},
22+
"homepage": "https://github.com/Mishra-coder/Zappify#readme",
23+
"dependencies": {
24+
"express": "^5.2.1"
25+
}
26+
}

0 commit comments

Comments
 (0)