Web app should be able to choose which MediaWiki-based wiki to fetch article content from. We do not want to hard-code wiki endpoints within the business logic and views for flexibility. For now, on project build, the wiki chosen will be set in stone. If you want to change the wiki then you have to update the config and rebuild the app.
The following endpoints from the wiki's Special:Version page (e.g. https://en.wikipedia.org/wiki/Special:Version) must be stored as environment variables to enable this functionality:
WIKI_ENDPOINT - Wiki endpoint (e.g. https://en.wikipedia.org)
ARTICLE_PATH - Article path (e.g. /wiki/)
ACTION_API - API path (e.g. /w/api.php)
WIKI_NAME - Wiki name (e.g. English Wikipedia)
WIKI_SKIN - Wiki skin path (e.g. /wiki/MediaWiki:Common.css)
Environment variables should be stored in a new .env file at the root project directory that should be added to .gitignore.
See the following on implementing environment variables:
If going with CI/CD, may have to add some additional strings to the appropriate .yml file of the CI/CD tool that contains environment variables (do not store secrets in there).
Web app should be able to choose which MediaWiki-based wiki to fetch article content from. We do not want to hard-code wiki endpoints within the business logic and views for flexibility. For now, on project build, the wiki chosen will be set in stone. If you want to change the wiki then you have to update the config and rebuild the app.
The following endpoints from the wiki's
Special:Version
page (e.g. https://en.wikipedia.org/wiki/Special:Version) must be stored as environment variables to enable this functionality:WIKI_ENDPOINT
- Wiki endpoint (e.g.https://en.wikipedia.org
)ARTICLE_PATH
- Article path (e.g./wiki/
)ACTION_API
- API path (e.g./w/api.php
)WIKI_NAME
- Wiki name (e.g.English Wikipedia
)WIKI_SKIN
- Wiki skin path (e.g./wiki/MediaWiki:Common.css
)Environment variables should be stored in a new
.env
file at the root project directory that should be added to .gitignore.See the following on implementing environment variables: