LaTeX - How to add code snippets or any example text

I recently had to write a report using LaTeX. I had a problem with inserting my code snippets into the report. Online I found many advanced ways of doing this, with code highlighting and other effects. All I wanted was a simple way to add my snippets. Since I am just writing a report the below will suffice, the solution was to use verbatim in LaTeX:

\begin{verbatim}
    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });
    }

\end{verbatim}

Know an easier way? Let me know in the comments down below!