This repository has been archived on 2022-06-19. You can view files and clone it, but cannot push or open issues or pull requests.
ContainerImage.WendyUI/Fastify/server.js

40 lines
791 B
JavaScript
Raw Normal View History

2022-01-20 14:16:21 +00:00
// Require the framework and instantiate it
const fastify = require('fastify')({ logger: true })
// Declare a route
fastify.get('/', async (request, reply) => {
2022-02-14 13:07:06 +00:00
return [
2022-02-14 12:40:44 +00:00
{
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'
2022-02-14 12:40:44 +00:00
}
2022-02-14 13:07:06 +00:00
]
2022-01-20 14:16:21 +00:00
})
// Run the server!
const start = async () => {
try {
2022-01-20 14:43:22 +00:00
await fastify.listen(3001, '0.0.0.0')
2022-01-20 14:16:21 +00:00
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
}
2022-01-20 14:41:04 +00:00
start()