async function serveGUI( url ) {
    
    let res, fileType;
    const headerContentTypes = {
        'html': 'text/html',
        'js': 'application/javascript',
        'css': 'text/css'
    }

    const pathname = ( url.pathname === '/' ) ? '/index.html' : url.pathname;
    res = await fetch( 'file://build' + pathname );
    
    fileType = pathname.split('.').pop();
    if( res.status === 200 && Object.keys( headerContentTypes ).includes( fileType ) ) {
        let fileText = await res.text();
        return { data: fileText, status: 200, contentType: headerContentTypes[ fileType ] };
    }

    return { data: "<p>Not found.</p>", status: 404, contentType: "text/html" };
}