You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, going to sandbox.edit.io (or a locally running edit-text instance) will open up the document that corresponds to the requester's IP address, e.g. /welcome-127-0-0-1. This code lives in edit-server.rs:
eprintln!("creating helloworld post for {:?}", id);
get_or_create_page_graphql(&id,&load_doc);
returnResponse::redirect_302(format!("/{}", id));
We want to add another check just before this which looks to see if the parameter "new" exists, and if so, sets the id to a random value (using random_id_alpha). It should also set the document contents to default_doc(), so once it's generated there will be a basic document template for the user to edit.
Some expectations about how this works:
?new=1 would redirect to a random document id with the header "Welcome" and some accompanying text.
If both new and from were supplied (e.g. ?new=1&from=markdown_content), we can assume that the "from" code will run last and take precedence.
Right now, going to
sandbox.edit.io
(or a locally running edit-text instance) will open up the document that corresponds to the requester's IP address, e.g./welcome-127-0-0-1
. This code lives inedit-server.rs
:edit-text/edit-server/src/bin/edit-server.rs
Lines 251 to 301 in 8bcb38a
We want to add another check just before this which looks to see if the parameter "new" exists, and if so, sets the id to a random value (using
random_id_alpha
). It should also set the document contents to default_doc(), so once it's generated there will be a basic document template for the user to edit.Some expectations about how this works:
?new=1&from=markdown_content
), we can assume that the "from" code will run last and take precedence.The text was updated successfully, but these errors were encountered: