I have a project which needs to create a dynamic manifest.json file for my PWA (ReactJS).
Please see below my codes:
app.service.js:
        function getAppDetails() {
            const requestOptions = {
                method: 'GET',
                headers: authHeader()
            };
            // TODO create dynamic manifest.json file here
            return fetch(`${config.apiUrl}/api/apps`, requestOptions).then(handleResponse);
        }   
        function handleResponse(response) {
            return response.text().then(text => {
                const data = text && JSON.parse(text);
                if (!response.ok) {
                    if (response.status === 401) {
                        // auto logout if 401 response returned from api
                        logout();
                        location.reload(true);
                    } 
                    const error = (data && data.message) || response.statusText;
                    return Promise.reject(error);
                }
                return data;
            });
}
app.actions.js:
function getAppDetails() {
        return dispatch => {
            dispatch(request());
            appService.getAppDetails()
                .then(
                    details => dispatch(success(details)),
                    error => dispatch(failure(error.toString()))
                );
        };
        function request() { return { type: appConstants.GETDETAILS_REQUEST } }
        function success(details) { return { type: appConstants.GETDETAILS_SUCCESS, details } }
        function failure(error) { return { type: appConstants.GETDETAILS_FAILURE, error } }
}
LoginPage.jsx:
    import { appActions } from '../_actions';
    class LoginPage extends React.Component {
        constructor(props) {
            super(props);
            // reset login status
            this.props.dispatch(userActions.logout());
            this.state = {
                email: '',
                password: '',
                isDisabled: false,
                submitted: false
            };
            this.handleChange = this.handleChange.bind(this);
            this.handleSubmit = this.handleSubmit.bind(this);
            this.showSwal = this.showSwal.bind(this);
        }
        componentDidMount() {
            // TODO call the action to add dynamic manifest file to index.html
            this.props.dispatch(aapActions.getAppDetails());
        }
        render() {
            return (
                ................
            );
        }
}
I am new to this kind of thing. How can I get started?