A simple, clean social news web application where users can submit and share links. Built with Express.js backend and vanilla JavaScript frontend.
- 📝 Submit new links with title, URL, and author
- 🔗 Automatic URL formatting (adds http:// if missing)
- 💬 Real-time success/error notifications
- 📱 Responsive Bootstrap-based design
- 🎨 Clean, modern UI with yellow theme
- ⚡ Fast and lightweight
- Backend: Node.js, Express.js
- Frontend: Vanilla JavaScript, HTML5, CSS3
- UI Framework: Bootstrap 3.3.7
- File Upload: Multer
- Body Parsing: body-parser
url_app/
├── server.js # Express server and API endpoints
├── package.json # Node.js dependencies
├── public/ # Static frontend files
│ ├── index.html # Main HTML page
│ ├── app.js # Frontend JavaScript logic
│ ├── script.js # Additional scripts (unused)
│ └── style.css # Custom styles
└── README.md # This file
- Clone the repository:
git clone <your-repo-url>
cd url_app- Install dependencies:
npm install- Start the server:
node server.js- Open your browser and navigate to:
http://localhost:3000
- Click the "Submit" button in the navigation bar
- Fill out the form with:
- Title: The title of your link
- URL: The web address (http:// will be added automatically if missing)
- Author: Your name or username
- Click "Submit" to add the link
- The link will appear at the top of the page
The app comes with two example links pre-loaded:
- "Hacker" by HeroMan (hero.com)
- "Book" by BookMan (book.com)
Accepts form data or JSON to add a new link.
Request Body:
{
"title": "Example Link",
"url": "example.com",
"author": "John Doe"
}Response:
{
"message": "The link Example Link has been successfully added!"
}- Express.js server with CORS enabled
- Handles POST requests to
/addlink - Serves static files from the
publicdirectory - Logs submitted links to console
- Link Class: Represents a link with title, URL, and author
- Message Class: Handles success/error notifications
- Form Handling: Dynamic form creation and submission
- DOM Manipulation: Adds new links to the page dynamically