Skip to content

Commit

Permalink
Copilot third commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arek-kilimar-allhuman committed Mar 5, 2024
1 parent 0f32d86 commit ce125fd
Showing 1 changed file with 4 additions and 54 deletions.
58 changes: 4 additions & 54 deletions comments.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,8 @@
// create web server
const express = require('express');
// create web server
const app = express();
// create web server
const port = 3000;

// create web server
app.get('/comments', (req, res) => {
res.send('Comments');
});

app.listen(port, () => {
console.log(`Server is listening on port: ${port}`);
});
```
```javascript
// Path: posts.js
// create web server
const express = require('express');
// create web server
const app = express();
// create web server
const port = 3000;

// create web server
app.get('/posts', (req, res) => {
res.send('Posts');
});

app.listen(port, () => {
console.log(`Server is listening on port: ${port}`);
});
```
```javascript
// Path: index.js
// create web server
const express = require('express');
// create web server
const app = express();
// create web server
const port = 3000;

const comments = require('./comments');
const posts = require('./posts');

// create web server
app.use('/comments', comments);
app.use('/posts', posts);

app.listen(port, () => {
console.log(`Server is listening on port: ${port}`);
});
```
app.use(express.json());

###
// create a comments array
const comments = [
{ username: 'alice', comment: 'I love this

0 comments on commit ce125fd

Please sign in to comment.