Skip to content

Apiki-Challenge-2 #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Miraak245
Copy link

@Miraak245 Miraak245 commented Jan 23, 2025

creating plugin => Apiki-Favorites\apiki-favorites.php

  • Wordpress: 6.7.1

added this plugin For Authentication: JWT Authentication for WP-API

added this code to wp-config.php:

...
define('JWT_AUTH_SECRET_KEY', '7Yqq05YKIlMxscXbgYh2kFNN_zs8GgTH1wuX-rfBDRT9o_RiajB5WfIAFH_Wwl5onQ6lXVylt23H_K-M6uKNYQ');
define('JWT_AUTH_CORS_ENABLE', true);

before this line:
/* That's all, stop editing! Happy publishing. */

Apiki-Favorites plug-in APIs:
adds favorite POST => http://localhost/wordpress/wp-json/apiki/v2/favorites?post_id=1
removes favorite DELETE => http://localhost/wordpress/wp-json/apiki/v2/favorites?post_id=1
gets all favorites GET => http://localhost/wordpress/wp-json/apiki/v2/favorites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant