How do you serve your HTML on the browser? - windows

I'm a web developer I recently got my computer wiped last week and now I'm downloading everything that I used to have. I'm starting a new project and I was trying to serve locally on the chrome browser with:
static .
but that command doesn't work for me anymore in the command prompt.
so I have to do this command:
start {file address}
so if I wanted to serve my HTML template I'd have to do this
start C:\dev\React-Basics\src\index.html
Does anybody know how I can fix this so I can use static . ?

It sound as if you had a simple node package to serve your files, perhaps node-static or something else.

Related

Vue js Development Code is Working fine but Production build Gives Blank white screen on Opening

Developers Recently i am working on a vue js Website, and everything is working fine on Development but when i build the code using npm run build , the production build gets successfully build but when i try to open the index.html file inside dist directory the file gets opened in Browser but a Blank white page gets Displayed.
You need to start your server, not open the file directly.
Because Vue builds files and connects JS and CSS like it would be on the server.
And now, when you are opening the file, it can't find JS/CSS.
How do you want to deploy your app? I think the following post can help you:
How to deploy vue app
Please check if you have a vue.config.js file and if the configuration is correct according to your project setup.

I am trying to open Nova and getting directories instead of welcome page

I have set-up a Laravel-Nova project. And when i try to open this URL (htttps://localhost/81/App/nova) it opens up this folders directory instead of opening nova/login page.
I have followed all the instructions but still it's not getting resolved.
I have tried looking for solution of it but didn't find anything.
Use php artisan serve in your Terminal and then go to http://127.0.0.1:8000/nova or any link which is getting generated by your terminal. THANKS!

Flask cached files, no new changes applied (still loads old .css and .js files)

I have simple flask application running on flask development server on Debian9. Everything worked fine until today. Now, when I change any of the files in static directory, the browser loads the old file and no change is displayed. 2 browsers tried: Chrome and IE.
I've tried this:
Clear all browser cache, refresh page = no effect
Install 2 brand new browsers (Vivaldi and Opera) = On the first time the URL was entered, old .css files were loaded
When I rename the .css file and accordingly modify the html, the changes are applied and everything looks fine until I make another change, then I have to rename it again.
I run flask app with flask run --host='0.0.0.0' --port='80'
I found many similar posts, everytime they were solved by clearing browser cache, or adding #app.after_request decorator, but it did'nt help in this case. I don't think this is browser cache related. Thank you for any advices.
After many desperate hours of trying, I find out, that this behaviour is caused by multiple ssh sessions opened to the server. I had 2 connections via putty, one for starting and stopping server, second for files modifications. I've tested it with opening and closing the second putty connection and it's definitely the cause of the problem. I don't know if this is related only to flask (I'm no linux expert), but maybe it'll help someone.

How to run Laravel project in browser using VS Code

I have an existing Laravel project, which I want to run in my browser, using VS Code. How do I do this?
There's a built-in terminal in vs code (on a different tab somewhere in the bottom), you can use it to serve your project by a local webserver, with the following command:
php artisan serve
After that you can see your project in your browser (localhost:8000 by default).
Please note this might not work out of the box on Windows.

Simple D3 tutorial not appearing

Used code from this tutorial:
http://bl.ocks.org/mbostock/3883245#index.html
Saved index.html
Saved data.tsv into the same directory
First, I tried opening the html by itself. That showed a blank web page (viewing the page source showed the code was indeed there).
Then, I ran python -m SimpleHTTPServer 8888 & in the directory (although I should not have needed this step). It showed a blank web page as well.
https://github.com/mbostock/d3/wiki
How do I get d3 working? Thanks
Just forgot that I renamed a file.
Incidentally, if you cannot get it to work you need to check your browser. The above tutorial did not work for me in Safari or Chrome on a mac but worked in Firefox. I got this information from here:
Very simple tutorial example of D3.js not working
and here:
https://github.com/mbostock/d3/wiki

Resources