Browse Source

deleted server

Inderjit Gill 5 months ago
parent
commit
a630126738
5 changed files with 7 additions and 1600 deletions
  1. 0
    1
      .gitignore
  2. 7
    43
      README.md
  3. 0
    1511
      server/Cargo.lock
  4. 0
    10
      server/Cargo.toml
  5. 0
    35
      server/src/main.rs

+ 0
- 1
.gitignore View File

@@ -1,6 +1,5 @@
1 1
 /assets/research
2 2
 /core/target
3
-/server/target
4 3
 /client/target
5 4
 /client/www/sokoban_client.js
6 5
 /client/www/sokoban_client_bg.wasm

+ 7
- 43
README.md View File

@@ -7,23 +7,16 @@ core : the core game code, independent of output format (native/web etc). Writte
7 7
 
8 8
 client : the web version, a wrapper around the core crate that generates wasm and js files
9 9
 build with:
10
-$ npm run build:dev
10
+$ cd client
11
+$ ./build.sh
11 12
 
12 13
 build release version with:
13
-$ npm run build:release
14
-
15
-the generated wasm and js files will be in client/www/wasm
16
-
17
-client/www : an npm package that uses the generated wasm and js files to build a web app.
18
-setup with:
19
-$ npm install
20
-
21
-dev with:
22
-$ npm run start
23
-build for production with:
24
-$ npm run build
14
+$ cd client
15
+$ ./build.sh release
25 16
 
26
-server : a separate rust codebase for serving the web app in client/www
17
+launch a server in client/www
18
+$ cd client/www
19
+$ basic-http-server
27 20
 
28 21
 (todo one day) native : a native build of Sokoban that wraps the core crate with a native sdk
29 22
 
@@ -33,33 +26,4 @@ $ rustup update
33 26
 $ rustup install nightly
34 27
 $ rustup target add wasm32-unknown-unknown --toolchain nightly
35 28
 $ cargo +nightly install wasm-bindgen-cli
36
-$ cd client/www
37
-$ npm install
38
-```
39
-## during dev
40
-in terminal 1:
41
-```sh
42
-$ cd client
43
-$ npm run build:dev
44
-```
45
-in terminal 2:
46
-```sh
47
-$ cd client/www
48
-$ npm run start
49
-```
50
-can now visit http://localhost:8080
51
-
52
-changes to the rust code will require re-running the terminal 1 command:
53
-```sh
54
-$ npm run build:dev
55 29
 ```
56
-
57
-## for 'release'
58
-```sh
59
-$ cd client
60
-$ npm run build:release
61
-$ cd client/www
62
-$ npm run build
63
-```
64
-
65
-todo: ensure that everything required for release is in the client/www/dist directory

+ 0
- 1511
server/Cargo.lock
File diff suppressed because it is too large
View File


+ 0
- 10
server/Cargo.toml View File

@@ -1,10 +0,0 @@
1
-[package]
2
-name = "sokoban-server"
3
-version = "0.1.0"
4
-authors = ["Inderjit Gill <email@indy.io>"]
5
-
6
-[dependencies]
7
-env_logger = "0.5.4"
8
-
9
-actix = "0.7"
10
-actix-web = "^0.7"

+ 0
- 35
server/src/main.rs View File

@@ -1,35 +0,0 @@
1
-extern crate actix;
2
-extern crate actix_web;
3
-extern crate env_logger;
4
-
5
-use actix_web::http::{header, Method};
6
-use actix_web::{
7
-    fs, middleware, server, App, HttpResponse,
8
-};
9
-
10
-
11
-fn main() {
12
-    ::std::env::set_var("RUST_LOG", "actix_web=info");
13
-    env_logger::init();
14
-    let sys = actix::System::new("sokoban-server");
15
-
16
-    server::new(|| {
17
-        App::new()
18
-            // enable logger
19
-            .middleware(middleware::Logger::default())
20
-            // redirect
21
-            // .resource("/", |r| r.method(Method::GET).f(|_req| {
22
-            //     HttpResponse::Found()
23
-            //         .header(header::LOCATION, "../client/index.html")
24
-            //         .finish()
25
-            // }))
26
-            // static files
27
-            .handler("/", fs::StaticFiles::new("../client/web").unwrap())
28
-    }).bind("127.0.0.1:8080")
29
-        .unwrap()
30
-        .shutdown_timeout(1)
31
-        .start();
32
-
33
-    println!("Started http server: 127.0.0.1:8080");
34
-    let _ = sys.run();
35
-}