A simple hello world application with a Node.js backend and SQLite database.
- Express.js REST API server
- SQLite database for data persistence
- CRUD operations for messages
- Health check endpoint
- Node.js (v14 or higher)
- npm
- Clone the repository:
git clone <repository-url>
cd absolutely-flawless- Install dependencies:
npm installStart the server:
npm startThe server will start on http://localhost:3000
Returns a simple hello world message.
Response:
{
"message": "Hello, World!",
"status": "success",
"timestamp": "2025-12-16T19:42:00.000Z"
}Check the health status of the application and database.
Response:
{
"status": "healthy",
"database": "connected",
"messageCount": 1
}Retrieve all messages from the database.
Response:
{
"messages": [
{
"id": 1,
"content": "Hello, World!",
"created_at": "2025-12-16 19:42:00"
}
],
"count": 1
}Create a new message in the database.
Request Body:
{
"content": "Your message here"
}Response:
{
"id": 2,
"content": "Your message here",
"message": "Message created successfully"
}You can test the API using curl:
# Test hello world endpoint
curl http://localhost:3000/
# Check health
curl http://localhost:3000/health
# Get all messages
curl http://localhost:3000/api/messages
# Create a new message
curl -X POST http://localhost:3000/api/messages \
-H "Content-Type: application/json" \
-d '{"content": "Hello from curl!"}'The application uses SQLite with a single messages table:
id: Auto-incrementing primary keycontent: Message textcreated_at: Timestamp of creation
The database file (database.db) is created automatically when the server starts.
absolutely-flawless/
├── server.js # Main application file
├── package.json # Node.js dependencies and scripts
├── database.db # SQLite database (auto-generated)
├── .gitignore # Git ignore rules
└── README.md # This file
ISC