Simulating the most external plasma region of a tokamak, the scrape-off layer (SOL), is of crucial importance on the path towards a fusion reactor as heat load on the vessel wall, impurity generation, and overall plasma confinement all depend on the plasma dynamics in this region. The GBS code has been developed to solve the drift-reduced Braginskii equations which describe turbulent behaviour of the plasma in the SOL. Until recently, only limited scenarios were considered in GBS and it was not possible to investigate diverted ones. This was mainly due to the use of field aligned coordinates, which present a singularity at the X-point, where the gradient of the magnetic poloidal flux vanishes. In the current work we will present the extension of the GBS code to the diverted case, performed thanks to the use of toroidal coordinates. Three main topics will be discussed: the analytical and numerical work behind the implementation of X-point configurations, the results of the code verification and convergence tests, and some first understanding of the plasma turbulence in the presence of a single-null configuration.