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

Recipes don't seed when running make dev_server #104

Open
SkepticMystic opened this issue Mar 9, 2024 · 3 comments
Open

Recipes don't seed when running make dev_server #104

SkepticMystic opened this issue Mar 9, 2024 · 3 comments

Comments

@SkepticMystic
Copy link

I want to get started understanding and contributing to Cooklang. Just looking around the codebase for now, and trying to get the dev_server running for the ui.
Everything builds and runs fine, but there aren't any recipes listed. Digging a little, I see that make dev_server runs the seed script, so I assume there should be some recipes on the ui? I've tried to find where they would be placed by default (base_path), but couldn't figure that out.
Can you point me in the right direction?

@dubadub
Copy link
Contributor

dubadub commented Mar 10, 2024

Yep, there should be recipes in UI when you run dev setup. They are stored in ./seed directory of the repo. When cargo run server ./seed & runs it uses that last argument to locate recipe files (and it's not a script, just a path to recipes for server command).

@SkepticMystic
Copy link
Author

Right, ok. I do see seeded recipes in ./seed.
When I visit the local ui app, the html loads fine. But the request to /api/recipes returns HTML, not JSON, so a JSON parsing error is thrown in the console, and no recipes show.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset='utf-8'>
	<meta name='viewport' content='width=device-width,initial-scale=1'>

	<title>Cook</title>
	<link rel='stylesheet' href='/vendor/bootstrap/css/bootstrap.min.css'>

	<link rel='icon' type='image/png' href='/favicon.png'>
	<link rel='stylesheet' href='/build/bundle.css'>

	<script defer src='/build/bundle.js'></script>
</head>

<body>
</body>
</html>

It's making the request to http://localhost:33689/api/recipes, not port 9080 where the I guess the cook server is running. Even though the rollup proxy is set

@TheMagicNacho
Copy link

Another method I found to work is using cargo run -- server which will build and run the server from the project root. The server will crawl recursively, so you should see a "seed" directory on the home page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants