Giter Site home page Giter Site logo

lr-http-server's People

Contributors

davydof avatar manuelcabral avatar oroce avatar pflannery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lr-http-server's Issues

Ability to open some url

Hello @manuelcabral :)

It will be a good if you add the ability to add some url to opening exist url when open the page, for example:
lr-http-server -d min/ -u index.html/#/main

And the server will open my server with url:
min/index.html/#/main

The u flag can set the url

Best regards!

RangeError: Maximum call stack size exceeded

I installed all dependencies and when i execute command "lr-http-server" console return white ... i don't know what i missing.. Finally return "node_modules\lr-http-server\node_modules\gaze\lib\gaze.js:331 return this._handleError(err);RangeError: Maximum call stack size exceeded"

Adding new files after server launch are not detected by gaze

This is because it's watching files using absolute paths. At this line

The fix for this would be to gaze at the relative paths instead.

    gaze(watchFiles, function(err, watcher) {
      if(err) {
        console.error("Unable to watch files", err);
      }
      this.on('all', function(event, filepath) {
        console.log(filepath + ' was ' + event);
        livereloadServer.changed({body:{files:filepath}});
      });
    });

@manuelcabral I can PR this.

RangeError: Maximum call stack size exceeded

/usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/gaze.js:331
    return this._handleError(err);
                ^
RangeError: Maximum call stack size exceeded
    at Gaze._watchDir (/usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/gaze.js:331:17)
    at /usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/gaze.js:387:10
    at iterate (/usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/helper.js:69:5)
    at /usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/helper.js:78:11
    at /usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/gaze.js:452:5
    at iterate (/usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/helper.js:69:5)
    at /usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/helper.js:78:11
    at /usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/gaze.js:452:5
    at iterate (/usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/helper.js:69:5)
    at /usr/local/lib/node_modules/lr-http-server/node_modules/gaze/lib/helper.js:78:11

Now getting this on latest version.

no matches found

Hello, I'm trying to use your script, but here, when I run:

$lr-http-server -p 80 -w **.*.html,**.*.js

I got:

zsh: no matches found: **.*.html,**.*.js

Correct path sent to LiveReload?

I believe this server sends the incorrect path to the LiveReload client: the path sent is the local path while LiveReload needs the http path.

does not inject script, no live reload.

Why does it not inject <script> to reload page on changes?

This is the HTML file, and it arrives to the browser un-modified:

<title>&lt;lume-gltf-model&gt;</title>

<style>
	html,
	body {
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		background: white;
		touch-action: none;
	}
</style>

<lume-scene id="scene" perspective="800" webgl fog-mode="linear" fog-near="100" fog-far="500" fog-color="white">
	<lume-ambient-light color="white" intensity="0.4"></lume-ambient-light>

	<lume-camera-rig active initial-distance="200" max-distance="700" min-distance="100">
		<lume-point-light position="200 0 200" intensity="0.7" color="white" slot="camera-child"></lume-point-light>
	</lume-camera-rig>

	<lume-node position="0 1000 0">
		<!--
		FIXME mesh with manual behaviors not working initially. Change the has
		attribute to something else and back, then it works. Code load order
		issue.
		-->
		<!-- <lume-mesh has="shape-geometry phong-material" size="0 0 5" color="white" position="30 0 0" sidedness="double" receive-shadow="false"> -->
		<lume-shape
			size="30 60 5"
			color="red"
			position="-120 0 0"
			mount-point="0.5 1"
			sidedness="double"
			receive-shadow="false"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="30 60 10"
			color="red"
			position="-50 0 0"
			mount-point="0.5 1"
			sidedness="double"
			receive-shadow="false"
			fitment="contain"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="30 60 15"
			color="red"
			position="30 0 0"
			mount-point="0.5 1"
			sidedness="double"
			receive-shadow="false"
			fitment="cover"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="30 60 15"
			color="red"
			position="50 0 0"
			mount-point="0.5 1"
			sidedness="double"
			receive-shadow="false"
			fitment="scale-down"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="10 60 15"
			color="red"
			position="100 0 0"
			mount-point="0.5 1"
			sidedness="double"
			receive-shadow="false"
			fitment="scale-down"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="30 10 15"
			color="red"
			position="120 0 0"
			mount-point="0.5 1"
			sidedness="double"
			receive-shadow="false"
			fitment="scale-down"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>
	</lume-node>

	<lume-node position="0 10 0" scale="-1 1 1">
		<lume-shape
			size="40 25 5"
			color="red"
			position="-120 0 0"
			mount-point="0.5 0"
			sidedness="double"
			receive-shadow="false"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="40 25 10"
			color="red"
			position="-50 0 0"
			mount-point="0.5 0"
			sidedness="double"
			receive-shadow="false"
			fitment="contain"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="40 25 15"
			color="red"
			position="0 0 0"
			mount-point="0.5 0"
			sidedness="double"
			receive-shadow="false"
			fitment="cover"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="40 25 15"
			color="red"
			position="50 0 0"
			mount-point="0.5 0"
			sidedness="double"
			receive-shadow="false"
			fitment="scale-down"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="40 10 15"
			color="red"
			position="100 0 0"
			mount-point="0.5 0"
			sidedness="double"
			receive-shadow="false"
			fitment="scale-down"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>

		<lume-shape
			size="10 25 15"
			color="red"
			position="120 0 0"
			mount-point="0.5 0"
			sidedness="double"
			receive-shadow="false"
			fitment="scale-down"
		>
			<lume-box
				visible="false"
				has="basic-material"
				opacity="0.9"
				size-mode="proportional proportional proportional"
				size="1 1 1"
				wireframe
			></lume-box>
		</lume-shape>
	</lume-node>

	<!-- prettier-ignore -->
	<!-- <test>
		<lume-mesh has="heart-2d-geometry phong-material" size="10 10 34" extrude shape-fit="contain"></lume-mesh>
		<lume-heart-2d size="10 10 34" extrude></lume-heart-2d>

		<lume-mesh has="path-shape-geometry phong-material" size="10 10 34" extrude shape-fit="contain" path="12.1 13, 5.3 16, 17 13"></lume-mesh>
		<lume-path-shape size="10 10 34" extrude shape-fit="contain" path="12.1 13, 5.3 16, 17 13"></lume-path-shape>
	</test> -->
</lume-scene>

<div class="ui">
	<fieldset>
		<legend>Options</legend>
		<label> <input type="checkbox" onchange="updateSize()" />&nbsp; Show size boundaries </label>
		<br />
		<label> <input type="checkbox" onchange="updateBevel()" />&nbsp; Bevel </label>
	</fieldset>
</div>

<script>
	let showSize = false
	const boxes = Array.from(document.querySelectorAll('lume-box'))

	function updateSize() {
		showSize = !showSize
		for (const box of boxes) box.visible = showSize
	}

	let bevel = false
	const hearts = Array.from(document.querySelectorAll('lume-shape'))

	function updateBevel() {
		bevel = !bevel
		console.log(bevel)
		for (const heart of hearts) {
			heart.bevel = bevel
			// if (bevel) heart.setAttribute('bevel', '')
			// else heart.removeAttribute('bevel')
		}
	}
</script>

<style>
	.ui {
		position: absolute;
		margin: 15px;
		padding: 10px;
		top: 0;
		left: 0;
		color: red;
		font-family: sans-serif;
		background: rgba(0, 0, 0, 0.1);
		border-radius: 7px;
	}

	fieldset legend {
		color: red;
	}
	fieldset {
		border-color: red;
		border-radius: 4px;
	}
</style>

<script src="global.js"></script>
<script>
	// Define all the LUME elements with their default names.
	LUME.useDefaultNames()
</script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.