Git Product home page Git Product logo

Comments (6)

LiamKarlMitchell avatar LiamKarlMitchell commented on July 21, 2024 1

@noway
If you want to host web client via express, you could just put a JS file a level up, install express via.

npm install -s express

And run code like this to serve the files.

const express = require('express')
const app = express()
const port = 3000
const path = require('path')

app.get('/', function(req, res){
   res.sendFile(path.resolve('Client/index.htm'))
});

app.use(express.static('Client'));

app.listen(port, () => console.log(`Quake WebClient http server listening on port ${port}!`))

Would recommend to also use a robots.txt to ignore from search engines and perhaps bundle/minify the js.

from webquake.

Triang3l avatar Triang3l commented on July 21, 2024

Because a custom web server is not comprehensive enough. Existing servers
have things like caching an compression. Also the server shouldn't be an
NPM module, because it's a complete app, not a library, and must not be
used in other apps.
On Apr 19, 2013 12:26 AM, "Way, No" [email protected] wrote:

Hi! I found your work pretty impressive!
For web server you use abyss web server, but why not simply use node.js,
like in Server/ part?
It would be much more uniform.

I think you should make Client/ as private npm module, like Server/ in my
last Pull Request


Reply to this email directly or view it on GitHubhttps://github.com//issues/7
.

from webquake.

noway avatar noway commented on July 21, 2024

Npm is not always library. Npm manages packages. Package may be whole app.
Because there's no need in deploying that project via npm, i turned on option "private": true in package.json (You can see it in pull request)
So that package not participates in npm registry. Npm here only manages dependencies.
You may say, that unnecessary setting up package.json just for one dependency, but npm would manage that dependency very well.
He would install only some versions of library, that you using. So you can don't worries that something brokes some day because of api change.
And, you can easily add another dependencies in future! Only 1 line in config, and users still can satisfy all dependencies via npm install.

from webquake.

noway avatar noway commented on July 21, 2024

About web server:
For example, express.js framework provides excellent capabilities. He has gzip compression, and caching (including Etag).
I created simple server with it, and fetching game resources from it. All works pretty well.

Connect.js also would handle this well.

And, in last, that libraries not so heavy (about 2M). They very easy to install, especially with the npm.
I think, that once there is node.js, it's much easier to use its capabilities, instead installing something else.

from webquake.

Triang3l avatar Triang3l commented on July 21, 2024

No, the goal of the project is to allow to easily install Quake anywhere on a website, not only under a specific subdomain. The main purpose of the project is not to be a proof of concept, it's to allow modders to show their mods without requiring the players to install Quake, and it's to be embedded to Quake demo sites (maybe I'll contact Speed Demos Archive owner about this). While node.js server would be optional, some users will think that it's the only way to play WebQuake, while it's not.

from webquake.

noway avatar noway commented on July 21, 2024

Ok then!
No node.js in Client/

from webquake.

Related Issues (20)

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.