Skip to content
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

Load a index.html page when open a Blank project #6729

Closed
Nowhk opened this issue Jul 20, 2020 · 4 comments
Closed

Load a index.html page when open a Blank project #6729

Nowhk opened this issue Jul 20, 2020 · 4 comments

Comments

@Nowhk
Copy link

Nowhk commented Jul 20, 2020

I've setup the CMS orchardcore as Blank, using it to only manage content via API, and the website is rendered using a frontend framework like Vue.js

So, all the front end project is build within wwwroot folder, and is accessible by index.html.

I'd like to recall that page calling www.mydomain.com, instead of www.mydomain.com/index.html

Would be nice to do it directly. Not sure if its achievable right now, can you add this feature?

@Nowhk Nowhk changed the title Load a index.html Page when open a Blank project Load a index.html page when open a Blank project Jul 20, 2020
@ns8482e
Copy link
Contributor

ns8482e commented Jul 20, 2020

You can set Home page in MVC / Razor - see following comment by @jtkech in another related issue.

#6235 (comment)

@Nowhk
Copy link
Author

Nowhk commented Jul 23, 2020

@ns8482e hi, thanks for the reply.

Tried this way:

public void ConfigureServices(IServiceCollection services)
{
	services.AddMvc().AddRazorPagesOptions(options => 
	{
		options.Conventions.AddPageRoute("/", "index.html");
	});

	services.AddOrchardCms();
}

But I got 500, and nothing load.

@Nowhk
Copy link
Author

Nowhk commented Jul 23, 2020

I think I've fixed it. I've simply add app.UseDefaultFiles(); before app.UseStaticFiles(); and it find index.html within wwwroot.

Is it correct in your opinion? Thanks

@Nowhk Nowhk closed this as completed Jul 23, 2020
@ns8482e
Copy link
Contributor

ns8482e commented Jul 23, 2020

@Nowhk Nice!,

However there is an open issue #6505 with UseStaticFiles() - currently it only works with Default tenant.

If you plan to use your vuejs app in multi tenant scenario i.e. www.mydomain.com/index.html, www.mydomain.com/tenant1/index.html , www.mydomain.com/tenant2/index.html then It's suggested that you use index.cshtml instead of static index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants