diff --git a/index.html b/index.html new file mode 100644 index 0000000..14d3d54 --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + Test assignment + + + +

Welcome

+ + + + \ No newline at end of file diff --git a/routes/tasks.js b/routes/tasks.js index b2bcfcb..2b436f0 100644 --- a/routes/tasks.js +++ b/routes/tasks.js @@ -71,6 +71,10 @@ function validateTaskData(taskData) { return { isValid: true }; } +askjdhakjshdka + +aksdhkjahdkahsd + // GET /api/tasks - Get all tasks // This route handles GET requests to /api/tasks // req = request object (contains data sent by client) diff --git a/server.js b/server.js index 47a9f9a..277dcb4 100644 --- a/server.js +++ b/server.js @@ -1,44 +1 @@ -import express from "express"; -import cors from "cors"; -import bodyParser from "body-parser"; - -// Import routes -import taskRoutes from "./routes/tasks.js"; - -// Initialize Express app -const app = express(); -const PORT = process.env.PORT || 3000; - -// Middleware -app.use(cors()); // Enable CORS for all routes -app.use(bodyParser.json()); // Parse JSON request bodies -app.use(bodyParser.urlencoded({ extended: true })); // Parse URL-encoded bodies - - -// Mount API routes -app.use("/api", taskRoutes); - -// Error handling middleware -app.use((err, req, res, next) => { - console.error(err.stack); - res.status(500).json({ - success: false, - message: "Something went wrong!", - error: process.env.NODE_ENV === "development" ? err.message : {}, - }); -}); - -// 404 handler for undefined routes -app.use("*", (req, res) => { - res.status(404).json({ - success: false, - message: "Route not found", - }); -}); - -// Start server -app.listen(PORT, () => { - console.log(`🚀 Server is running on http://localhost:${PORT}`); -}); - -export default app; +console.log("TEST PROJECT HERE") \ No newline at end of file