Skip to content

Commit

Permalink
Merge pull request #372 from rajnishdargan/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-2413 feat: Integration of V1 Content Player in Teachers app
  • Loading branch information
itsvick authored Nov 7, 2024
2 parents b5eaed4 + 1d63b75 commit 5179e76
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ const remotes = (isServer) => {
};
};

const PORTAL_BASE_URL = "https://sunbird-editor.tekdinext.com";

const routes = {
API: {
GENERAL: {
CONTENT_PREVIEW: "/content/preview/:path*",
CONTENT_PLUGINS: "/content-plugins/:path*"
}
}
};

const nextConfig = {
eslint: {
// Disabling on production builds because we're running checks on PRs via GitHub Actions.
Expand Down Expand Up @@ -66,6 +77,14 @@ const nextConfig = {
source: '/app/telemetry', // Match telemetry route
destination: `${process.env.WORKSPACE_BASE_URL}/api/telemetry`, // Redirect to telemetry proxy
},
{
source: routes.API.GENERAL.CONTENT_PREVIEW,
destination: `${PORTAL_BASE_URL}${routes.API.GENERAL.CONTENT_PREVIEW}`, // Proxy to portal
},
{
source: routes.API.GENERAL.CONTENT_PLUGINS,
destination: `${PORTAL_BASE_URL}${routes.API.GENERAL.CONTENT_PLUGINS}`, // Proxy to portal
}
];
},
webpack: (config, { isServer }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/services/PlayerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios';

export const fetchContent = async (identifier: any) => {
try {
const API_URL = `${process.env.NEXT_PUBLIC_WORKSPACE_BASE_URL}${URL_CONFIG.API.CONTENT_READ}${identifier}`;
const API_URL = `${URL_CONFIG.API.CONTENT_READ}${identifier}`;
const FIELDS = URL_CONFIG.PARAMS.CONTENT_GET;
const LICENSE_DETAILS = URL_CONFIG.PARAMS.LICENSE_DETAILS;
const MODE = 'edit';
Expand All @@ -20,7 +20,7 @@ export const fetchContent = async (identifier: any) => {

export const getHierarchy = async (identifier: any) => {
try {
const API_URL = `${process.env.NEXT_PUBLIC_WORKSPACE_BASE_URL}${URL_CONFIG.API.HIERARCHY_API}${identifier}`;
const API_URL = `${URL_CONFIG.API.HIERARCHY_API}${identifier}`;
const response = await axios.get(API_URL);
console.log('response =====>', response);
return response?.data?.result?.content || response?.data?.result;
Expand Down

0 comments on commit 5179e76

Please sign in to comment.