
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
github.com/umangraval/go-mongodb-rest-boilerplate
This repo can be used as a starting point for backend development with Golang. It comes bundled with Docker. The development environment uses docker-compose
to start dependent services like mongo.
A few things to note in the project:
$ git clone git@github.com:umangraval/Go-Mongodb-REST-boilerplate.git your-app-name
$ cd your-app-name
$ go mod vendor
Starting the dev server also starts MongoDB as a service in a docker container using the compose script at docker-compose.yml
.
$ go run main.go routes.go
Running the above commands results in
http://localhost:8080
mongodb://localhost:27017/db
$ go build
$ cd tests
$ go test
$ docker build -t api-server .
$ docker run -t -i -p 8080:8080 api-server
$ docker-compose up
To edit environment variables, create a file with name .env
and copy the contents from .env.default
to start with.
Var Name | Type | Default | Description |
---|---|---|---|
JWT_SECRET | string | secret | JWT secret to verify |
PORT | number | 8080 | Port to run the API server on |
MONGO_URL | string | mongodb://localhost:27017/db | URL for MongoDB |
+-- controllers
| +-- personController.go
+-- db
| +-- db.go
+-- handlers
| +-- config.go
| +-- logs.go
| +-- response.go
| +-- verifyJWT.go
+-- models
| +-- models.go
+-- validators
| +-- validators.go
+-- tests
| +-- api_test.go
+-- routes
| +-- routes.go
+-- uploaded
+-- vendor
+-- nginx
| +-- dev.conf.d
| | +-- nginx.conf
+-- .env
+-- .env.default
+-- .gitignore
+-- docker-compose.yml
+-- Dockerfile
+-- go.mod
+-- go.sum
+-- main.go
+-- README.md
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.