Created
September 17, 2021 16:35
-
-
Save ivanahuckova/61ab7e34ffcfa655d6a71da962588fd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const cors = require('cors'); | |
const faker = require('faker'); | |
const app = express(); | |
const data = []; | |
for (let i = 0; i < 200000; i++) { | |
let firstName = faker.name.firstName(); | |
let lastName = faker.name.lastName(); | |
data.push(`${firstName}_${lastName}_${firstName}_${lastName}`); | |
} | |
const PORT = process.env.PORT || 1111; | |
app.use(cors()); | |
app.get('/api/v1/label/__name__/values', (req, res) => { | |
res.status(200).json({ | |
status: 'success', | |
data, | |
}); | |
}); | |
app.listen(PORT, () => console.log(`App listening at http://localhost:${PORT}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment