Skip to content

Commit

Permalink
Merge pull request #30 from rtCamp/develop
Browse files Browse the repository at this point in the history
Redesign the Demo site
  • Loading branch information
pradeep910 authored Jan 24, 2024
2 parents 23bee54 + 9427175 commit 605be3d
Show file tree
Hide file tree
Showing 49 changed files with 2,555 additions and 188 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.set('views', __dirname); // Set the views directory

// Middleware to set global variables for use in EJS templates
app.use((req, res, next) => {
res.locals.commonPath = path.join(__dirname, 'common');
res.locals.commonPath = path.join(__dirname, 'src/common');
res.locals.protocol = process.env.protocol;
res.locals.domainA = process.env['domain-a'];
res.locals.domainB = process.env['domain-b'];
Expand All @@ -53,9 +53,9 @@ app.use((req, res, next) => {
});

// Mount routes for different demo types
const demoTypes = ['chips', 'first-party-sets', 'private-state-tokens', 'fedcm'];
const demoTypes = ['chips', 'related-websites-sets', 'private-state-tokens', 'fedcm'];
demoTypes.forEach(demoType => {
const demoRoutes = require(`./demos/${demoType}/routes`);
const demoRoutes = require(`./src/demos/${demoType}/routes`);
app.use(`/${demoType}`, demoRoutes); // Mount the routes on a path specific to the demo type
});

Expand All @@ -68,13 +68,13 @@ const scenarios = [
'payment-gateway',
];
scenarios.forEach(scenario => {
const scenarioRoutes = require(`./scenarios/${scenario}/routes`);
const scenarioRoutes = require(`./src/scenarios/${scenario}/routes`);
app.use(`/${scenario}`, scenarioRoutes); // Mount the routes on a path specific to the scenario
});

// Catch-all route handler for unmatched routes, rendering the default page
app.use((req, res) => {
res.render(path.join(__dirname, 'common/index'), {
res.render(path.join(__dirname, 'src/common/index'), {
title: 'Privacy Sandbox Demos'
});
});
Expand Down
2 changes: 0 additions & 2 deletions common/footer.ejs

This file was deleted.

8 changes: 0 additions & 8 deletions common/header.ejs

This file was deleted.

48 changes: 0 additions & 48 deletions common/index.ejs

This file was deleted.

18 changes: 0 additions & 18 deletions demos/chips/analytics-first-party.ejs

This file was deleted.

18 changes: 0 additions & 18 deletions demos/chips/analytics-third-party.ejs

This file was deleted.

18 changes: 0 additions & 18 deletions demos/chips/index.ejs

This file was deleted.

Loading

0 comments on commit 605be3d

Please sign in to comment.