---
# System prepended metadata

title: Music Library ArtistRouter and ArtistController
tags: [solution, music-library, track]

---

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

# Music Library ArtistRouter and ArtistController
```javascript=
// src/controllers/artist.js
const createArtist = (req, res) => {
    res.sendStatus(201);
}

module.exports = { createArtist }
```


```javascript=
// src/routes/artist.js
const express = require('express');
const artistController = require('../controllers/artist');

const router = express.Router();

router.post('/', artistController.createArtist);

module.exports = router;
```

```javascript=
// src/app.js
const express = require('express');
const artistRouter = require('./routes/artist');

const app = express();

app.use(express.json());

app.use('/artists', artistRouter);

module.exports = app;

```