A better live server
.php
files4 ways to start your live server.
Something is not working? Try the simple setup below:
www
on the desktopindex.html
(see below)www
with VSCode<!DOCTYPE html>
<html>
<head>
<title>HTML Test File</title>
</head>
<body>
<h1>It works!</h1>
</body>
</html>
The setup above works but your project not?
OneDrive
or DropBox
?Although Five Server can render, display and live reload PHP, it does not provide a full PHP server. If you want to develop a big PHP app, you manually have to link the client-side Five Server script with your PHP files. See five-server-with-php.
π‘ Most advanced features are disabled by default.
Turn them on in the settings or by configuring a fiveserver.config.js
file in the root of your workspace.
Note:
.html
and .php
files.highlight
, injectBody
and remoteLogs
are disable by default.highlight
feature, injectBody
has to be activated.injectBody
performs some simple HTML Validation. When using injectBody
, a message will be displayed if your HTML Page is invalid.highlight
for a single HTML Tag, add a H.<div H>Don't highlight me</div>
Config File Example:
// fiveserver.config.js
module.exports = {
highlight: true, // enable highlight feature
injectBody: true, // enable instant update
remoteLogs: true, // enable remoteLogs
remoteLogs: "yellow", // enable remoteLogs and use the color yellow
injectCss: false, // disable injecting css
navigate: true, // enable auto-navigation
};
/src/types.ts
./src/colors.ts
.injectBody
does not work well when using inline JavaScript inside <body>
.<script>
const main = () => {
console.log("Some JavaScript Code...");
};
// wait for five-server to connect
const five = document.querySelector('[data-id="five-server"]');
if (five) five.addEventListener("connected", main);
else window.addEventListener("load", main);
</script>
Need to debug something? Set debugVSCode
to true.
// fiveserver.config.js
module.exports = {
debugVSCode: true,
};
No release notes while < v1.0.0