Skip to content

Commit 538771b

Browse files
committed
respond to create movie operation with static fake data
1 parent 4756d76 commit 538771b

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎movies/src/index.js‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,16 @@ const port = process.env.PORT || 3000;
44

55
app.listen(port, function () {
66
console.log(`Example API listening on port ${port}!`);
7-
});
7+
});
8+
9+
app.post('/movies', (req, res) => {
10+
res.status(201);
11+
res.setHeader('Location', '/movies/d517cae6-6cdc-11e9-a923-1681be663d3e');
12+
res.setHeader('Content-Type', 'application/ld+json');
13+
res.send({
14+
"@context": "/context.jsonld",
15+
"@id": "/movies/d517cae6-6cdc-11e9-a923-1681be663d3e",
16+
"@type": "schema:Movie",
17+
"schema:name": "Fake Movie"
18+
});
19+
});

0 commit comments

Comments
 (0)