Tuesday 30 January 2018

A new package to create mock-server

Hello :) This package is probably the best solution to create a fake server in Node.js, it uses Express.js and Faker.js to get the job done.GitHub (Just go and check the example :) )Personally, I created this project because I needed sth like this while developing a React appHere is an example that creates a dataset which contains 200 item based on the given schema :const Videos = Mock.dataset({ uuid: Mock.primaryKey(Faker.random.uuid), title: Faker.lorem.sentence, category: Mock.oneOf('PHP', 'Node.js', 'React', 'React Native'), tags: Mock.someOf('fun', 'google', 'summer', 'hello', 'sth', 'how-to') }, 200)

Submitted January 30, 2018 at 11:51PM by qti3e

No comments:

Post a Comment