Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Apr 17, 2024
2 parents 1fbb93f + 6c66597 commit f1264b7
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@
}
},
"cli": {
"analytics": false
"analytics": false
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"type": "git",
"url": "https://github.com/primefaces/primeng.git"
},
"type": "module",
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.1",
"@angular-eslint/eslint-plugin": "17.3.0",
Expand Down
27 changes: 20 additions & 7 deletions server.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import express from 'express';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { dirname, join, resolve } from 'node:path';
import bootstrap from './src/main.server';
import { environment } from 'src/environments/environment';

// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const distFolder = join(process.cwd(), 'dist/primeng/browser');
const indexHtml = join(distFolder, 'index.html');
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
const browserDistFolder = resolve(serverDistFolder, '../browser');
const indexHtml = join(serverDistFolder, 'index.server.html');

const commonEngine = new CommonEngine();

server.set('view engine', 'html');
server.set('views', distFolder);
server.set('views', browserDistFolder);

// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser
server.get(
'*.*',
express.static(distFolder, {
express.static(browserDistFolder, {
maxAge: '1y'
})
);
Expand All @@ -35,7 +36,7 @@ export function app(): express.Express {
bootstrap,
documentFilePath: indexHtml,
url: `${protocol}://${headers.host}${originalUrl}`,
publicPath: distFolder,
publicPath: browserDistFolder,
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }]
})
.then((html) => res.send(html))
Expand All @@ -44,3 +45,15 @@ export function app(): express.Express {

return server;
}

function run(): void {
const port = process.env['PORT'] || 4000;

// Start up the Node server
const server = app();
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}

run();
2 changes: 1 addition & 1 deletion src/app/showcase/data/news.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"id": 63,
"content": "Introducing the new Aura theme",
"linkText": "Learn More",
"linkHref": "http://localhost:4200/theming"
"linkHref": "https://primeng.org/theming"
}
4 changes: 2 additions & 2 deletions src/app/showcase/layout/topbar/app.topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
</div>

<ul class="flex list-none m-0 p-0 gap-2 align-items-center ">
<li>
<!-- <li>
<div id="docsearch"></div>
</li>
</li> -->
<li>
<a href="https://github.com/primefaces/primeng" target="_blank" rel="noopener noreferrer"
class="flex px-link border-1 border-solid w-2rem h-2rem surface-border border-round surface-card align-items-center justify-content-center transition-all transition-duration-300 hover:border-primary">
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/layout/topbar/app.topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AppTopBarComponent implements OnDestroy {

afterNextRender(() => {
this.bindScrollListener();
this.initDocSearch();
// this.initDocSearch();
});
}

Expand Down
16 changes: 0 additions & 16 deletions vercel.json

This file was deleted.

0 comments on commit f1264b7

Please sign in to comment.