---
# System prepended metadata

title: '''gets artist record by id'' solution'
tags: [solution, music-library, track]

---

---
tags: music-library,solution,track
---


# 'gets artist record by id' solution

```js
exports.getArtistById = (req, res) => {
  const { id } = req.params;
  Artist.findByPk(id).then(artist => {
    res.status(200).json(artist);
  });
};
```