Skip to content

Commit

Permalink
code editor is working now
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed May 27, 2020
1 parent c514748 commit f0a4182
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,5 +606,9 @@ def read_item(request: Request, filename:str):
async def change_essay_code(request: Request):
data = await request.json()
code = data["code"]
filename = data["filename"]
(app_path / "site" / "essay" / filename).write_text(code)
filename = data["filename"] + '.html'
path = (app_path / "site" / "essay" / filename)
if path.exists():
path.write_text(code)
else:
return {'error':'file does not exist'}
2 changes: 1 addition & 1 deletion app/site/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
course_id: "HIST101"
description: "A class for all who live on this blue marble."

url: "http://localhost:8000"
url: "blini.apjan.co"
dev: true
# change header/footer gradient css?
#theme: fun

0 comments on commit f0a4182

Please sign in to comment.