Skip to content

Commit 22c7458

Browse files
committed
minor changes
1 parent 10fc465 commit 22c7458

File tree

8 files changed

+21
-12
lines changed

8 files changed

+21
-12
lines changed

backend/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ COPY . .
55
RUN rustup default nightly
66
RUN cargo build --release
77
RUN cargo install diesel_cli --no-default-features --features postgres
8-
CMD diesel setup
9-
CMD ./target/release/backend
8+
CMD diesel setup && diesel migration run && ./target/release/backend

backend/Rocket.toml

-2
This file was deleted.

backend/src/files.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use rocket::response::NamedFile;
2+
use std::path::{Path, PathBuf};
3+
4+
#[get("/")]
5+
pub fn index() -> Option<NamedFile> {
6+
NamedFile::open("public/index.html").ok()
7+
}
8+
9+
#[get("/<file..>", rank = 2)]
10+
pub fn files(file: PathBuf) -> Option<NamedFile> {
11+
NamedFile::open(Path::new("public/").join(file)).ok()
12+
}

backend/src/main.rs

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rocket::{catchers, routes};
1212
pub mod models;
1313
pub mod api;
1414
pub mod database;
15+
pub mod files;
1516
pub mod handlers;
1617
pub mod responses;
1718
pub mod schema;
@@ -23,6 +24,10 @@ pub fn rocket_factory(database_url: &str) -> rocket::Rocket {
2324
rocket::ignite()
2425
.manage(database::init_pool(database_url))
2526
.mount("/", routes![
27+
files::index,
28+
files::files,
29+
])
30+
.mount("/api", routes![
2631
api::projects,
2732
api::user,
2833
api::generate_verification,

data/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
FROM postgres:13-alpine
33
WORKDIR /data
44
VOLUME /var/lib/postgresql/data:/data/db
5-
ENV POSTGRES_DB postgres
65
ENV POSTGRES_USER postgres
76
ENV POSTGRES_PASSWORD postgres
7+
ENV POSTGRES_DB data

docker-compose.yml

-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ services:
77
- 8000
88
depends_on:
99
- subcomp-data
10-
subcomp-frontend:
11-
build: ./frontend
12-
ports:
13-
- "5000:5000"
14-
- 5000
1510
subcomp-data:
1611
build: ./data
1712
ports:

frontend/src/components/ChangeFullName.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ChangeFullName extends React.Component {
3434
</InputGroup.Prepend>
3535
<FormControl
3636
type="text"
37-
placeholder="Andrew Taylor"
37+
placeholder="John Jeremy"
3838
aria-label="full name"
3939
onChange={event => {
4040
this.setState({

frontend/src/components/SignUp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SignUp extends React.Component {
5353
</InputGroup.Prepend>
5454
<FormControl
5555
type="text"
56-
placeholder="Thomas Kunc"
56+
placeholder="Jashank Shepherd"
5757
aria-label="full name"
5858
onChange={event => {
5959
this.setState({

0 commit comments

Comments
 (0)