Attempting to get local and remote repos back in sync
This commit is contained in:
parent
ba3978fffb
commit
1497d2d8dc
47 changed files with 5106 additions and 2539 deletions
111
src/server.ts
111
src/server.ts
|
|
@ -1,89 +1,34 @@
|
|||
import path from 'path';
|
||||
import express from 'express';
|
||||
import mime from 'mime';
|
||||
|
||||
import { Application } from 'express';
|
||||
import { App, Initializer } from '@BridgemanAccessible/ba-web-framework';
|
||||
import { PointerServer } from '@BridgemanAccessible/ba-auth';
|
||||
|
||||
const app = express();
|
||||
const domain = process.env.DOMAIN || 'localhost';
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.render('index.ejs', {
|
||||
title: 'Home',
|
||||
business: {
|
||||
location: 'Winnipeg, Canada'
|
||||
/**
|
||||
* Callback for when the app starts.
|
||||
*
|
||||
* @param app The Express app that gets created/started.
|
||||
*/
|
||||
function onStart(app: Application) {
|
||||
// Currently within the Server class implementation,
|
||||
// which is then implemented by the accounts dashboard,
|
||||
// only the RFC8414 path/callback is setup by default
|
||||
//
|
||||
// this should be easy enough to change but don't want to fiddle with it right now
|
||||
//const oidcLink = PointerServer.createOIDCLink('account.bridgemanaccessible.ca');
|
||||
const rfc8414Link = PointerServer.createRFC8414Link('account.bridgemanaccessible.ca');
|
||||
PointerServer.setup(app, { links: [/*oidcLink, */rfc8414Link] });
|
||||
}
|
||||
|
||||
async function main() {
|
||||
await (new App()).run(new Initializer({
|
||||
controllersPath: path.resolve(__dirname, 'routes'),
|
||||
staticFilesPath: path.resolve(__dirname, 'static'),
|
||||
view: {
|
||||
filesPath: path.resolve(__dirname, 'pages')
|
||||
}
|
||||
});
|
||||
});
|
||||
}), onStart);
|
||||
}
|
||||
|
||||
app.get('/about', (req, res) => {
|
||||
res.render('about.ejs', {
|
||||
title: 'About',
|
||||
people: [
|
||||
{
|
||||
fname: 'Alan',
|
||||
lname: 'Bridgeman',
|
||||
position: 'Proprietor, CEO & Lead Developer',
|
||||
bio: '' +
|
||||
'Alan has been an avid disability advocate for over a decade including being a part of or involved with a variety of civic, provincial, national and international organizations around disability or accessibility. ' +
|
||||
'Alan has held numerous certifications including but not limited to: Mental Health First Aid, Certified Professional in Accessibility Core Competinies (CPACC) with the International Association of Accessibility Professionals (IAAP), among others. ' +
|
||||
'In additioan to his involvment in the disability community Alan is a dedicated and passionate software developer with a significant amount of experience in the industry. ' +
|
||||
'He has worked on a wide variety of projects, from small websites for research teams and non-profits to large enterprise applications at fourtune 500 companites like Microsoft. ' +
|
||||
'He has a strong background in web and cloud development, but has also worked on desktop and mobile applications. He has worked with many different technologies, including C#, Python, JavaScript, TypeScript, React, Node.js, Java, and many more. ' +
|
||||
'Alan startecd Bridgeman Accessible because he saw over and over again companies that were lead by non-disabled people and non-developers trying to solve digital accessibility problems. ' +
|
||||
'Moreover, they would only every consult or give advice but never build or innovate in ways that would help the community and the industry in a meaningful and impactful way.',
|
||||
image: 'alan.jpeg',
|
||||
website: 'https://alanbridgeman.ca/',
|
||||
email: 'alan@alanbridgeman.ca'
|
||||
},
|
||||
//{
|
||||
// fname: 'John',
|
||||
// lname: 'Oberton',
|
||||
// position: 'Infrastructure Developer (Project by Project basis/Contract)'
|
||||
//},
|
||||
//{
|
||||
// fname: 'Trevor',
|
||||
// lname: 'Xie',
|
||||
// position: 'Designer (Project by Project basis/Contract)'
|
||||
//}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/services', (req, res) => {
|
||||
res.render('services.ejs', {
|
||||
title: 'Services'
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/products', (req, res) => {
|
||||
res.render('products.ejs', {
|
||||
title: 'Products'
|
||||
});
|
||||
});
|
||||
|
||||
app.set('view engine', 'ejs');
|
||||
app.set('views', path.join(__dirname, 'views'));
|
||||
|
||||
app.use(express.static(path.join(__dirname, 'public'), {
|
||||
setHeaders: (res, path) => {
|
||||
if (mime.getType(path) === 'text/html') {
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
}
|
||||
else if (mime.getType(path) === 'text/css') {
|
||||
res.setHeader('Content-Type', 'text/css');
|
||||
}
|
||||
else if (mime.getType(path) === 'application/javascript') {
|
||||
res.setHeader('Content-Type', 'application/javascript');
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
const oidcLink = PointerServer.createOIDCLink('account.bridgemanaccessible.ca');
|
||||
const rfc8414Link = PointerServer.createRFC8414Link('account.bridgemanaccessible.ca');
|
||||
PointerServer.setup(app, { links: [oidcLink, rfc8414Link] });
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running on port ${port}`);
|
||||
});
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue