
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple-api-backend
Advanced tools
A simple full-stack application demonstrating how frontend (HTML/CSS/JavaScript) communicates with backend (Express.js API).
Backend:
/api/version)Version Management:
Frontend:
.
├── server.js # Main server file
├── database.js # SQLite database setup and initialization
├── data.db # SQLite database file (created automatically)
├── routes/
│ └── v1/ # Version 1 routes
│ ├── index.js # V1 router
│ ├── users.js # User endpoints (uses SQLite)
│ └── posts.js # Post endpoints (uses SQLite)
├── public/ # Frontend files
│ ├── index.html # Main HTML page
│ ├── style.css # Styling
│ └── app.js # Frontend JavaScript (API calls)
├── package.json
└── README.md
npm install
npm run dev
npm start
The server will start on http://localhost:3000
Start the server:
npm start
# or for development with auto-reload:
npm run dev
Open your browser:
Navigate to http://localhost:3000 to see the frontend interface.
Try it out:
Frontend (public/app.js):
fetch() APIBackend (server.js & routes/):
Example Flow:
/api/v1/users (frontend → backend)http://localhost:3000GET /api/v1/users - Get all usersGET /api/v1/users/:id - Get user by IDPOST /api/v1/users - Create a new userPUT /api/v1/users/:id - Update a userDELETE /api/v1/users/:id - Delete a userGET /api/v1/posts - Get all postsGET /api/v1/posts/:id - Get post by IDPOST /api/v1/posts - Create a new postPUT /api/v1/posts/:id - Update a postDELETE /api/v1/posts/:id - Delete a postGET / - API informationGET /health - Health check endpointGET /api/version - Get application version informationcurl -X POST http://localhost:3000/api/v1/users \
-H "Content-Type: application/json" \
-d '{"name": "Alice", "email": "alice@example.com"}'
curl http://localhost:3000/api/v1/users
curl -X POST http://localhost:3000/api/v1/posts \
-H "Content-Type: application/json" \
-d '{"title": "My Post", "content": "Post content", "authorId": 1}'
To add a new version (e.g., v2):
routes/v2/server.js, add:
const v2Routes = require('./routes/v2');
app.use('/api/v2', v2Routes);
This allows you to maintain backward compatibility while introducing new features.
This application uses SQLite for data persistence. The database file (data.db) is automatically created when you first run the server.
Users Table:
id (INTEGER, PRIMARY KEY, AUTOINCREMENT)name (TEXT, NOT NULL)email (TEXT, NOT NULL, UNIQUE)created_at (DATETIME, DEFAULT CURRENT_TIMESTAMP)Posts Table:
id (INTEGER, PRIMARY KEY, AUTOINCREMENT)title (TEXT, NOT NULL)content (TEXT, NOT NULL)author_id (INTEGER, NOT NULL, FOREIGN KEY → users.id)created_at (DATETIME, DEFAULT CURRENT_TIMESTAMP)When you first start the server, sample users and posts are automatically created if the database is empty.
data.db is created in the project root.gitignore)You can use any SQLite browser tool to view the database:
sqlite3 data.dbThis application uses semantic-release for automated versioning based on Conventional Commits.
Version is automatically determined from commit messages:
feat: → Minor version bump (1.0.0 → 1.1.0)fix: → Patch version bump (1.0.0 → 1.0.1)feat!: or BREAKING CHANGE: → Major version bump (1.0.0 → 2.0.0)chore:, docs:, style: → No version bumpIn Frontend:
Via API:
curl http://localhost:3000/api/version
When you push commits to main branch with conventional commit messages:
package.json versionCHANGELOG.md automatically# Minor version bump (new feature)
git commit -m "feat: add user authentication"
# Patch version bump (bug fix)
git commit -m "fix: resolve database connection issue"
# Major version bump (breaking change)
git commit -m "feat!: remove deprecated API endpoint
BREAKING CHANGE: The /api/v1/old endpoint has been removed"
# No version bump (documentation)
git commit -m "docs: update README"
Install dependencies (already done):
npm install
Add NPM_TOKEN to GitHub Secrets (if publishing to npm):
NPM_TOKEN (generate in npm account)GITHUB_TOKEN is automatically providedStart committing with conventional messages:
git commit -m "feat: your new feature"
git push origin main
See DOCUMENTATION.md for detailed versioning information.
FAQs
Simple backend API with versioning support
We found that simple-api-backend demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.