Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bin/Debug/net8.0/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
13 changes: 13 additions & 0 deletions bin/Debug/net8.0/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"dbconn": "dbconn-from-local",
"colour": "lightblue",
"site": "somesite",
"auth": "https://alwayson",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Binary file added bin/Debug/net8.0/slots
Binary file not shown.
23 changes: 23 additions & 0 deletions bin/Debug/net8.0/slots.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"slots/1.0.0": {
"runtime": {
"slots.dll": {}
}
}
}
},
"libraries": {
"slots/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file added bin/Debug/net8.0/slots.dll
Binary file not shown.
Binary file added bin/Debug/net8.0/slots.pdb
Binary file not shown.
19 changes: 19 additions & 0 deletions bin/Debug/net8.0/slots.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
1 change: 1 addition & 0 deletions bin/Debug/net8.0/slots.staticwebassets.runtime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ContentRoots":["/home/runner/work/Slots/Slots/wwwroot/","/home/runner/work/Slots/Slots/obj/Debug/net8.0/scopedcss/bundle/"],"Root":{"Children":{"css":{"Children":{"site.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"css/site.css"},"Patterns":null}},"Asset":null,"Patterns":null},"favicon.ico":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"favicon.ico"},"Patterns":null},"js":{"Children":{"site.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"js/site.js"},"Patterns":null}},"Asset":null,"Patterns":null},"lib":{"Children":{"bootstrap":{"Children":{"dist":{"Children":{"css":{"Children":{"bootstrap-grid.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.css"},"Patterns":null},"bootstrap-grid.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.css.map"},"Patterns":null},"bootstrap-grid.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.min.css"},"Patterns":null},"bootstrap-grid.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.min.css.map"},"Patterns":null},"bootstrap-grid.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.css"},"Patterns":null},"bootstrap-grid.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map"},"Patterns":null},"bootstrap-grid.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css"},"Patterns":null},"bootstrap-grid.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map"},"Patterns":null},"bootstrap-reboot.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.css"},"Patterns":null},"bootstrap-reboot.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.css.map"},"Patterns":null},"bootstrap-reboot.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.min.css"},"Patterns":null},"bootstrap-reboot.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.min.css.map"},"Patterns":null},"bootstrap-reboot.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.css"},"Patterns":null},"bootstrap-reboot.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map"},"Patterns":null},"bootstrap-reboot.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css"},"Patterns":null},"bootstrap-reboot.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map"},"Patterns":null},"bootstrap-utilities.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.css"},"Patterns":null},"bootstrap-utilities.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.css.map"},"Patterns":null},"bootstrap-utilities.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.min.css"},"Patterns":null},"bootstrap-utilities.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.min.css.map"},"Patterns":null},"bootstrap-utilities.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.css"},"Patterns":null},"bootstrap-utilities.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map"},"Patterns":null},"bootstrap-utilities.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css"},"Patterns":null},"bootstrap-utilities.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map"},"Patterns":null},"bootstrap.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.css"},"Patterns":null},"bootstrap.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.css.map"},"Patterns":null},"bootstrap.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.min.css"},"Patterns":null},"bootstrap.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.min.css.map"},"Patterns":null},"bootstrap.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.css"},"Patterns":null},"bootstrap.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.css.map"},"Patterns":null},"bootstrap.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.min.css"},"Patterns":null},"bootstrap.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.min.css.map"},"Patterns":null}},"Asset":null,"Patterns":null},"js":{"Children":{"bootstrap.bundle.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.js"},"Patterns":null},"bootstrap.bundle.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.js.map"},"Patterns":null},"bootstrap.bundle.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.min.js"},"Patterns":null},"bootstrap.bundle.min.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.min.js.map"},"Patterns":null},"bootstrap.esm.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.js"},"Patterns":null},"bootstrap.esm.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.js.map"},"Patterns":null},"bootstrap.esm.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.min.js"},"Patterns":null},"bootstrap.esm.min.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.min.js.map"},"Patterns":null},"bootstrap.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.js"},"Patterns":null},"bootstrap.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.js.map"},"Patterns":null},"bootstrap.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.min.js"},"Patterns":null},"bootstrap.min.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.min.js.map"},"Patterns":null}},"Asset":null,"Patterns":null}},"Asset":null,"Patterns":null},"LICENSE":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/LICENSE"},"Patterns":null}},"Asset":null,"Patterns":null},"jquery-validation-unobtrusive":{"Children":{"jquery.validate.unobtrusive.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"},"Patterns":null},"jquery.validate.unobtrusive.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"},"Patterns":null},"LICENSE.txt":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation-unobtrusive/LICENSE.txt"},"Patterns":null}},"Asset":null,"Patterns":null},"jquery-validation":{"Children":{"dist":{"Children":{"additional-methods.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/additional-methods.js"},"Patterns":null},"additional-methods.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/additional-methods.min.js"},"Patterns":null},"jquery.validate.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/jquery.validate.js"},"Patterns":null},"jquery.validate.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/jquery.validate.min.js"},"Patterns":null}},"Asset":null,"Patterns":null},"LICENSE.md":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/LICENSE.md"},"Patterns":null}},"Asset":null,"Patterns":null},"jquery":{"Children":{"dist":{"Children":{"jquery.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/dist/jquery.js"},"Patterns":null},"jquery.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/dist/jquery.min.js"},"Patterns":null},"jquery.min.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/dist/jquery.min.map"},"Patterns":null}},"Asset":null,"Patterns":null},"LICENSE.txt":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/LICENSE.txt"},"Patterns":null}},"Asset":null,"Patterns":null}},"Asset":null,"Patterns":null},"slots.styles.css":{"Children":null,"Asset":{"ContentRootIndex":1,"SubPath":"slots.styles.css"},"Patterns":null}},"Asset":null,"Patterns":[{"ContentRootIndex":0,"Pattern":"**","Depth":0}]}}
104 changes: 104 additions & 0 deletions new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Storybook build outputs
.out
.storybook-out

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
Copy link

Copilot AI Jun 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding the '/obj' directory to .gitignore to avoid tracking build artifacts generated during the build process.

Copilot uses AI. Check for mistakes.
.vscode-test
68 changes: 68 additions & 0 deletions new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Slots Node.js Express Application

This is a Node.js Express version of the original ASP.NET Core MVC Slots application.

## Features

- Express.js web framework
- EJS templating engine
- Bootstrap CSS framework
- Static file serving
- Configuration via environment variables
- Application Insights support (when configured)

## Installation

```bash
cd new
npm install
```

## Running the Application

```bash
npm start
```

The application will be available at http://localhost:3000

## Configuration

Set these environment variables to configure the application:

- `PORT` - Server port (default: 3000)
- `SITE` - Site name (default: "AZ-2008")
- `COLOUR` - Background color (default: "#f8f9fa")
- `DBCONN` - Database connection string (default: "Default DB Connection String")
- `AUTH` - Authentication URL (default: "Default Auth URL")
- `INSIGHTS` - Application Insights connection string (optional)

## Routes

- `/` - Home page
- `/home` - Home page (alternative)
- `/home/about` - About page
- `/home/contact` - Contact page
- `/home/privacy` - Privacy policy page

## Project Structure

```
new/
├── app.js # Main Express application
├── package.json # Node.js dependencies and scripts
├── views/ # EJS templates
│ ├── home/ # Home controller views
│ │ ├── index.ejs # Home page
│ │ ├── about.ejs # About page
│ │ ├── contact.ejs # Contact page
│ │ └── privacy.ejs # Privacy page
│ └── shared/ # Shared templates
│ ├── layout.ejs # Main layout
│ └── error.ejs # Error page
└── public/ # Static files
├── css/ # Stylesheets
├── js/ # JavaScript files
├── lib/ # Third-party libraries
└── favicon.ico # Site icon
```
82 changes: 82 additions & 0 deletions new/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
const express = require('express');
const path = require('path');
const expressLayouts = require('express-ejs-layouts');

const app = express();
const port = process.env.PORT || 3000;

// Configuration object to mimic the ASP.NET Core IConfiguration
const config = {
site: process.env.SITE || 'AZ-2008',
colour: process.env.COLOUR || '#f8f9fa',
dbconn: process.env.DBCONN || 'Default DB Connection String',
auth: process.env.AUTH || 'Default Auth URL',
insights: process.env.INSIGHTS || ''
};

// Set view engine to EJS
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
app.use(expressLayouts);
app.set('layout', 'shared/layout');

// Static files middleware
app.use(express.static(path.join(__dirname, 'public')));

// Routes - mirroring HomeController actions
app.get('/', (req, res) => {
res.render('home/index', {
title: 'Home Page for AZ-2008',
config: config
});
});

app.get('/home', (req, res) => {
res.render('home/index', {
title: 'Home Page for AZ-2008',
config: config
});
});

app.get('/home/about', (req, res) => {
res.render('home/about', {
title: 'About',
config: config
});
});

app.get('/home/contact', (req, res) => {
res.render('home/contact', {
title: 'Contact Us',
config: config
});
});

app.get('/home/privacy', (req, res) => {
res.render('home/privacy', {
title: 'Privacy Policy',
config: config
});
});

// Error handling middleware
app.use((req, res, next) => {
res.status(404).render('shared/error', {
title: 'Page Not Found',
config: config,
error: { message: 'Page not found', status: 404 }
});
});

app.use((err, req, res, next) => {
console.error(err.stack);
res.status(500).render('shared/error', {
title: 'Error',
config: config,
error: { message: 'Internal Server Error', status: 500 }
});
});

app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
Loading