diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..4ed3852
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2019-2024 Patryk Kisielewski
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/SmartHome-Server/App.config b/SmartHome-Server/App.config
index 731f6de..4bfa005 100644
--- a/SmartHome-Server/App.config
+++ b/SmartHome-Server/App.config
@@ -1,6 +1,6 @@
-
+
-
+
-
\ No newline at end of file
+
diff --git a/SmartHome-Server/HttpServer.cs b/SmartHome-Server/HttpServer.cs
index f76a664..6d9133c 100644
--- a/SmartHome-Server/HttpServer.cs
+++ b/SmartHome-Server/HttpServer.cs
@@ -5,6 +5,7 @@
using System.Net;
using System.IO;
using System.Web;
+using Microsoft.AspNetCore.StaticFiles;
namespace SmartHome_Server
{
@@ -57,8 +58,13 @@ private void NewRequest(object _context)
string path = "files"+request.Url.AbsolutePath;
if(request.Url.AbsolutePath == "/")
{
- path += "index.html";
- } else if(request.Url.AbsolutePath == "/plan")
+ path += "plan.html";
+ }
+ else if (request.Url.AbsolutePath == "/dashboard")
+ {
+ path = "files/index.html";
+ }
+ else if(request.Url.AbsolutePath == "/plan")
{
path += ".html";
}
@@ -95,7 +101,8 @@ private void NewRequest(object _context)
if (File.Exists(path))
{
responseBytes = File.ReadAllBytes(path);
- response.ContentType = MimeMapping.GetMimeMapping(path);
+ new FileExtensionContentTypeProvider().TryGetContentType(path, out string contentType);
+ response.ContentType = contentType;
}
else
{
diff --git a/SmartHome-Server/Properties/AssemblyInfo.cs b/SmartHome-Server/Properties/AssemblyInfo.cs
index 250343f..7e19123 100644
--- a/SmartHome-Server/Properties/AssemblyInfo.cs
+++ b/SmartHome-Server/Properties/AssemblyInfo.cs
@@ -1,16 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-
-// Ogólne informacje o zestawie są kontrolowane poprzez następujący
-// zestaw atrybutów. Zmień wartości tych atrybutów, aby zmodyfikować informacje
-// powiązane z zestawem.
-[assembly: AssemblyTitle("SmartHome-Server")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SmartHome-Server")]
-[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -21,16 +11,3 @@
// Następujący identyfikator GUID jest identyfikatorem biblioteki typów w przypadku udostępnienia tego projektu w modelu COM
[assembly: Guid("470cb9c4-98e0-481f-8b86-667a193d3afb")]
-
-// Informacje o wersji zestawu zawierają następujące cztery wartości:
-//
-// Wersja główna
-// Wersja pomocnicza
-// Numer kompilacji
-// Rewizja
-//
-// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
-// przy użyciu symbolu „*”, tak jak pokazano poniżej:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SmartHome-Server/SmartHome-Server.csproj b/SmartHome-Server/SmartHome-Server.csproj
index 4ea007e..1ea442b 100644
--- a/SmartHome-Server/SmartHome-Server.csproj
+++ b/SmartHome-Server/SmartHome-Server.csproj
@@ -1,65 +1,17 @@
-
-
-
+
- Debug
- AnyCPU
- {470CB9C4-98E0-481F-8B86-667A193D3AFB}
Exe
SmartHome_Server
- SmartHome-Server
- v4.6.1
- 512
- true
- true
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+
+ net8.0
+ false
+ SmartHome-Server
+ SmartHome-Server
+ Copyright © 2019-2024
+ 1.0.0.0
+ 1.0.0.0
-
-
- ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
PreserveNewest
@@ -86,5 +38,11 @@
PreserveNewest
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SmartHome-Server/files/index.html b/SmartHome-Server/files/index.html
index 7e139e1..978f273 100644
--- a/SmartHome-Server/files/index.html
+++ b/SmartHome-Server/files/index.html
@@ -66,8 +66,8 @@
Patryk Kisielewski
Uniwersytet Mikołaja Kopernika w Toruniu
Wydział Matematyki i Informatyki
-
19. Toruński Festiwal Nauki i Sztuki
-
Piątek, 26 kwietnia 2019
+
22. Toruński Festiwal Nauki i Sztuki
+
Niedziela, 21 kwietnia 2024