Skip to content

Instantly share code, notes, and snippets.

@Markonis
Created March 18, 2019 16:11
Show Gist options
  • Save Markonis/abf8c105a053be4bc230d5bb54c962f2 to your computer and use it in GitHub Desktop.
Save Markonis/abf8c105a053be4bc230d5bb54c962f2 to your computer and use it in GitHub Desktop.
// Initialize the express server
const server = express();
server.use(bodyParser.json());
// Mount the recipes API handlers
const mounter = new ExpressApiMounter(server);
mounter.mountHandler(api.recipe.create, create);
mounter.mountHandler(api.recipe.read, read);
mounter.mountHandler(api.recipe.update, update);
mounter.mountHandler(api.recipe.destroy, destroy);
mounter.mountHandler(api.recipe.list, list);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment