-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with MVC application #61
Comments
Hello,
By MVC, did you mean ASP.net MVC? EmbedIO doesn't support it by default,
you need to include the OWIN provider and setup the routes and controllers
load.
EmbedIO is not intended to port ASP.net webapps, that's why we provide our
own WebAPI.
…On Jan 23, 2017 12:25 AM, "Ercin Dedeoglu" ***@***.***> wrote:
I have a mvc website and i would like to embed it with embedio...
I tried above code but no luck.
[image: screenshot_4]
<https://cloud.githubusercontent.com/assets/6512072/22193617/a5dcf46c-e14d-11e6-9a61-99f83528b446.png>
Unosquare.Labs.EmbedIO.WebServer server = new Unosquare.Labs.EmbedIO.WebServer(port, new Unosquare.Labs.EmbedIO.Log.SimpleConsoleLog());
server.RegisterModule(new Unosquare.Labs.EmbedIO.Modules.LocalSessionModule());
server.RegisterModule(new Unosquare.Labs.EmbedIO.Modules.StaticFilesModule(path));
server.Module<Unosquare.Labs.EmbedIO.Modules.StaticFilesModule>().UseRamCache = true;
server.RunAsync();
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#61>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABsYsC5yYkMxrvSaIVWjyySUlOMAXPv3ks5rVEfBgaJpZM4Lqs0Y>
.
|
hi @geoperez , could you give me an example? How to setup routes? |
You need to check the following sample from https://github.com/unosquare/embedio-extras: public class Program
{
/// <summary>
/// Entry point
/// </summary>
/// <param name="args"></param>
private static void Main(string[] args)
{
// UseOwin() function returns Owin App for configuration
using (var webServer = WebServer
.Create("http://localhost:4578")
.WithWebApi(typeof (PeopleController).Assembly)
.UseOwin((owinApp) =>
owinApp
.UseDirectoryBrowser()
.UseRazor(InitRoutes)))
{
webServer.RunAsync();
Console.ReadKey();
}
}
/// <summary>
/// Initialize the Razor files
/// </summary>
/// <param name="table"></param>
public static void InitRoutes(IRouteTable table)
{
table
.AddFileRoute("/about/me", "Views/about.cshtml", new { Name = "EmbedIO Razor", Date = DateTime.UtcNow });
}
} Where the Extension Method Again, this is a experimental extension and EmbedIO is not focus on support OWIN. |
Closig ticket. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a mvc website and i would like to embed it with embedio...
I tried above code but no luck.
The text was updated successfully, but these errors were encountered: