
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
github.com/zy-131/url-shortener-api
URL Shortening API in GoLang
Follow these instructions to download and run the project on your local machine
Clone the repository:
Navigate to your project directory
Run the following command in your terminal:
git clone https://github.com/zy-131/url-shortener-api.git
cd url-shortener-api
Initialize the Go module:
go mod init <module-name>
Install dependencies:
go mod tidy
Navigate to your local project's root directory
Run the following command to start your local server:
go run ./src/
With the server running, open a new terminal or Postman and send a POST
request with the URL that you want to shorten
Note: A GET
request without an inital succesful POST
request will result in a 404 StatusNotFound
error
Example (Powershell cURL):
curl http://localhost:8080/shortenURL -METHOD POST -BODY '{"long_url": "<original-url>"}'
Open the shortened URL in a browser
Ex: localhost:8080/abc123
POST /shortenURL
Content-Type: application/json
{
"long_url": "https://www.example.com"
}
The long_url
field is required and will return a 400 StatusBadRequest
error if missing
Status Code:
201 Created
if successfulResponse Body:
"abc123"
404 StatusBadRequest
{
"message": "No URL passed in"
}
GET /:shortenURL
shortURL
: The shortened URL identifier (ex: abc123
from http://localhost:8080/abc123
)302 Found
if shortened URL exists
Location
header will contain original URL and cliented will be redirected
404 StatusNotFound
if the shortened URL does not exist{
"message": "Short URL not found"
}
In progress ...
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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.