I have and file called server.js which has the code bellow and I wanna have a folder called views and inside that a folder called circles to build the html to load the array showed bellow, but I think I need to change the path of circles I actually never done that, and there's no place to build the html inside the application, thats why I wanna do that so I can build and load the array on the html. I just need the circle part.I'm sorry I have never worked using a node application.
const express = require('express')
const cors = require('cors')
const app = express()
const circles = [
{
id: 1,
name: 'Twitter',
image: 'img/twitter.jpg',
color: '#aa2b31',
size: 3
},
{
id: 2,
name: 'Facebook',
image: 'img/facebook.jpg',
color: '#63e184',
size: 1
},
{
id: 3,
name: 'Skype',
image: 'img/skype.png',
color: '#033d49',
size: 2
},
]
app.use(express.static('public'))
app.use(cors())
app.get('/', (req, res) => {
const help = `
`
res.send(help)
})
app.get('/circles', (req, res) => {
res.send(circles)
})
app.listen(3001, () => {
console.log('Server listening on port 3001')
})