UNPKG

create-node-template

Version:

Create node.js or express boilerplate with one command

12 lines (10 loc) 286 B
import axios from 'axios'; export const fetchUsers = async () => { try { const posts = await axios.get('https://jsonplaceholder.typicode.com/users'); /* Any other business logic, e.g. publish events, etc. */ return posts.data; } catch (error) { throw error; } };