Article Title
Content goes here...
Create Responsive Web Design
Example Prompt:
Example Response:
Responsive Layout
Website Title
Welcome to Our Website
Your success is our priority.
Article Title
Content goes here...
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
}
header {
background: #333;
color: #fff;
padding: 10px 0;
}
nav ul {
list-style: none;
display: flex;
justify-content: center;
}
nav ul li {
margin: 0 15px;
}
nav ul li a {
color: #fff;
text-decoration: none;
}
.hero {
background: #f4f4f4;
padding: 20px;
text-align: center;
}
.content {
padding: 20px;
}
footer {
text-align: center;
padding: 10px 0;
background: #333;
color: #fff;
}
@media (max-width: 768px) {
nav ul {
flex-direction: column;
}
}
Related Tasks:
Develop RESTful APIs
Example Prompt:
Example Response:
npm install express mongoose bcryptjs jsonwebtoken
const express = require('express');
const mongoose = require('mongoose');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const app = express();
app.use(express.json()); // Middleware to parse JSON requests
// MongoDB User Schema
const userSchema = new mongoose.Schema({
username: { type: String, required: true, unique: true },
password: { type: String, required: true }
});
const User = mongoose.model('User', userSchema);
// Connect to MongoDB
mongoose.connect('mongodb://localhost:27017/authDB', { useNewUrlParser: true, useUnifiedTopology: true });
// User Registration
app.post('/register', async (req, res) => {
const { username, password } = req.body;
const hashedPassword = await bcrypt.hash(password, 10);
const newUser = new User({ username, password: hashedPassword });
await newUser.save();
res.status(201).send('User registered successfully');
});
// User Login
app.post('/login', async (req, res) => {
const { username, password } = req.body;
const user = await User.findOne({ username });
if (!user) return res.status(400).send('User not found');
const isMatch = await bcrypt.compare(password, user.password);
if (!isMatch) return res.status(400).send('Invalid credentials');
const token = jwt.sign({ id: user._id }, 'your_jwt_secret', { expiresIn: '1h' });
res.json({ token });
});
// Start the server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
Related Tasks:
Identify and Fix Bugs
Example Prompt:
Example Response:
Related Tasks:
Manage Git Repositories
Example Prompt:
Example Response:
<<<<<<< HEAD
Your changes here
=======
Changes from the other branch here
>>>>>>> feature-branch
git add
git commit -m "Resolved merge conflict in "
Related Tasks:
Create Technical Documentation
Example Prompt:
Example Response:
git clone https://github.com/yourusername/your-repo.git
cd your-repo
npm install
DATABASE_URL=mongodb://localhost:27017/yourdb
JWT_SECRET=your_jwt_secret
PORT=3000
npm start
{
"username": "string",
"password": "string"
}
{
"username": "string",
"password": "string"
}
Related Tasks: