// Require the framework and instantiate it const fastify = require('fastify')({ logger: true }) // Declare a route fastify.get('/', async (request, reply) => { return [ { component: 'VI_IT_VIRTUALIZATION', version: '2.4.0', os: 'vSphere 7.0U3a' }, { component: 'VI_IT_SRV_LIN_UBUNTU', version: '1.3.0', os: 'Ubuntu 18.04 LTS' }, { component: 'VI_IT_SRV_WIN', version: '3.9.1', os: 'Windows Server 2019 Enterprise' }, { component: 'VI_IT_CLT_WIN', version: '3.6.0', os: 'Windows 10 IoT Enterprise' } ] }) // Run the server! const start = async () => { try { await fastify.listen(3001, '0.0.0.0') } catch (err) { fastify.log.error(err) process.exit(1) } } start()