Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup client deployment #48

Merged
merged 13 commits into from
Feb 7, 2022
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ install-server: #- Install server dependencies
install-client: #- Install client dependencies
cd client && npm ci

build: #- Build production assets
cd client && npm run build

serve: #- Serve both the server and the client in parallel
make -j 2 serve-server serve-client

Expand All @@ -26,6 +29,12 @@ serve-server: #- Run API server
serve-client: #- Run the client
./tools/colorize_prefix.sh [client] 33 "cd client && npm run dev"

serve-dist: #- Serve both the server and the built client in parallel
make -j 2 serve-server serve-dist-client

serve-dist-client: #- Run the built client
./tools/colorize_prefix.sh [client] 33 "cd client && npm start"

migrate: #- Apply pending migrations
${bin}alembic upgrade head

Expand Down
4 changes: 1 addition & 3 deletions client/cypress/integration/home_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const server = "http://127.0.0.1:3579";

describe("Basic form submission", () => {
it("Visits the home page", () => {
const title = "Un nom de jeu de données";
Expand All @@ -9,7 +7,7 @@ describe("Basic form submission", () => {
cy.get("#title").type(title).should("have.value", title);
cy.get("#description").type(description).should("have.value", description);

cy.intercept("POST", `${server}/datasets/`).as("new-dataset");
cy.intercept("POST", `/api/datasets/`).as("new-dataset");
cy.get("button").click().contains("loading...");
cy.wait("@new-dataset").should(({ request, response }) => {
expect(request.method).to.equal("POST");
Expand Down