A simple way: take the current name of the script, make it the full path, and then take its directory:
(path-only (path->complete-path (find-system-path 'run-file)))
But you are rather interested not in the file that was used to do things (the web server), but in the actual source file into which you put your code. That is, you want some resources to be close to your source. An older way to do this:
(require mzlib/etc) (this-expression-source-directory)
The best way to do this is to use "runtime-path", which is a way of defining such resources:
(require racket/runtime-path) (define-runtime-path my-picture "pic.png")
This is the best sine, it also registers the path as something that depends on your script - therefore, if you were going to pack your code as an installer, for example, Racket would know that the package would also be downloaded to the png file.
And finally, you can use it to specify the entire directory:
(define-runtime-path HERE ".") ... (build-path HERE "pic.png") ...
source share